summaryrefslogtreecommitdiff
path: root/src/main-view/PacksTreeModel.h
blob: f04036dc0053bc9fc1fa65ca68bb6d440ac58144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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