diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2021-07-14 11:49:10 +1200 |
commit | d24f813f3f2a05c112e803e4256b53535895fc98 (patch) | |
tree | 601e6ae9a1cd44bcfdcf91739a5ca36aedd827c9 /src/main-view/PacksTreeModel.h |
Diffstat (limited to 'src/main-view/PacksTreeModel.h')
-rw-r--r-- | src/main-view/PacksTreeModel.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/main-view/PacksTreeModel.h b/src/main-view/PacksTreeModel.h new file mode 100644 index 0000000..f04036d --- /dev/null +++ b/src/main-view/PacksTreeModel.h @@ -0,0 +1,32 @@ +#ifndef PACKSTREEMODEL_H +#define PACKSTREEMODEL_H + +#include <QAbstractItemModel> + +#include "../dictionary/CardPack.h" + +class AppModel; + +class PacksTreeModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + PacksTreeModel( AppModel* aAppModel, QObject* aParent = 0); + + QVariant data( const QModelIndex &index, int role ) const; + Qt::ItemFlags flags( const QModelIndex &index ) const; + QVariant headerData( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const; + QModelIndex index( int row, int column, const QModelIndex &parent = QModelIndex() ) const; + QModelIndex parent( const QModelIndex &index ) const; + int rowCount( const QModelIndex &parent = QModelIndex() ) const; + int columnCount( const QModelIndex &/*parent*/ = QModelIndex() ) const { return 3; } + +public slots: + void updateData(); + +private: + AppModel* m_appModel; +}; + +#endif // PACKSTREEMODEL_H |