2014-09-19 01:10:05 +02:00
|
|
|
#ifndef _OBJECTLISTMODEL_HPP_
|
|
|
|
#define _OBJECTLISTMODEL_HPP_
|
|
|
|
|
|
|
|
#include <QAbstractItemModel>
|
|
|
|
|
2015-04-24 19:09:21 +02:00
|
|
|
#include <engine/GameData.hpp>
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
class ObjectListModel : public QAbstractTableModel {
|
|
|
|
Q_OBJECT
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
GameData* _gameData;
|
2014-09-19 01:10:05 +02:00
|
|
|
|
|
|
|
public:
|
2016-09-09 22:13:21 +02:00
|
|
|
explicit ObjectListModel(GameData* gameDat, QObject* parent = 0);
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
GameData* gameData() const {
|
|
|
|
return _gameData;
|
|
|
|
}
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2018-08-30 02:19:38 +02:00
|
|
|
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2018-08-30 02:19:38 +02:00
|
|
|
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2018-08-30 02:19:38 +02:00
|
|
|
QVariant data(const QModelIndex& index,
|
|
|
|
int role = Qt::DisplayRole) const override;
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2018-08-30 02:19:38 +02:00
|
|
|
QVariant headerData(int section, Qt::Orientation orientation,
|
|
|
|
int role = Qt::DisplayRole) const override;
|
2014-09-19 01:10:05 +02:00
|
|
|
|
2018-08-30 02:19:38 +02:00
|
|
|
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
|
2014-09-19 01:10:05 +02:00
|
|
|
};
|
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
#endif // _OBJECTLISTMODEL_HPP_
|