mirror of
https://github.com/isledecomp/SIEdit.git
synced 2024-12-02 11:57:35 -05:00
28 lines
641 B
C
28 lines
641 B
C
|
#ifndef MODEL_H
|
||
|
#define MODEL_H
|
||
|
|
||
|
#include <core.h>
|
||
|
#include <QAbstractItemModel>
|
||
|
|
||
|
class Model : public QAbstractItemModel
|
||
|
{
|
||
|
public:
|
||
|
explicit Model(QObject *parent = nullptr);
|
||
|
|
||
|
si::Core *GetCore() const { return core_; }
|
||
|
void SetCore(si::Core *c);
|
||
|
|
||
|
virtual QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
|
||
|
virtual QModelIndex parent(const QModelIndex &index) const override;
|
||
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||
|
|
||
|
protected:
|
||
|
si::Core *GetCoreFromIndex(const QModelIndex &index) const;
|
||
|
|
||
|
private:
|
||
|
si::Core *core_;
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif // MODEL_H
|