1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 11:22:45 +01:00
openrw/rwviewer/models/ItemListModel.hpp

36 lines
923 B
C++
Raw Normal View History

2014-06-08 02:58:49 +02:00
#ifndef ITEMLISTMODEL_HPP
#define ITEMLISTMODEL_HPP
#include <QAbstractItemModel>
#include <engine/GameWorld.hpp>
2016-09-09 22:13:21 +02:00
class ItemListModel : public QAbstractTableModel {
Q_OBJECT
2014-06-08 02:58:49 +02:00
2016-09-09 22:13:21 +02:00
GameWorld* _world;
2014-06-08 02:58:49 +02:00
public:
2016-09-09 22:13:21 +02:00
explicit ItemListModel(GameWorld* _world, QObject* parent = 0);
2014-06-08 02:58:49 +02:00
2016-09-09 22:13:21 +02:00
GameWorld* world() const {
return _world;
}
2014-06-08 02:58:49 +02:00
2016-09-09 22:13:21 +02:00
qint16 getIDOf(unsigned int row) const;
2014-06-10 01:46:48 +02:00
2018-08-30 02:19:38 +02:00
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
2014-06-08 02:58:49 +02:00
2018-08-30 02:19:38 +02:00
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
2014-06-08 02:58:49 +02:00
2018-08-30 02:19:38 +02:00
QVariant data(const QModelIndex& index,
int role = Qt::DisplayRole) const override;
2014-06-08 02:58:49 +02:00
2018-08-30 02:19:38 +02:00
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const override;
2014-06-10 01:46:48 +02:00
2018-08-30 02:19:38 +02:00
QModelIndex index(int row, int column, const QModelIndex& parent) const override;
2014-06-08 02:58:49 +02:00
};
2016-09-09 22:13:21 +02:00
#endif // ITEMLISTMODEL_HPP