SIEdit/app/model.h
2022-07-11 01:48:50 -07:00

27 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