-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtreemodel.h
34 lines (22 loc) · 997 Bytes
/
treemodel.h
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
33
34
#ifndef TREEMODEL_H
#define TREEMODEL_H
#include <QObject>
#include <QAbstractItemModel>
namespace Qt3DCore { class QEntity; }
class TreeModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit TreeModel(Qt3DCore::QEntity *root, QObject *parent = 0);
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QModelIndex parent(const QModelIndex &index) const Q_DECL_OVERRIDE;
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
int columnCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE;
QVariant data(const QModelIndex &index, int role) const Q_DECL_OVERRIDE;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
//Qt::ItemFlags flags(const QModelIndex &index) const Q_DECL_OVERRIDE;
Qt3DCore::QEntity *root() const;
private:
Qt3DCore::QEntity *m_root;
};
#endif // TREEMODEL_H