simpletreemodel.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef SIMPLETREEMODEL_H
00022 #define SIMPLETREEMODEL_H
00023
00024 #include <QAbstractItemModel>
00025 #include "src/data/node/node.h"
00026
00027 class SimpleTreeModel : public QAbstractItemModel
00028 {
00029 public:
00030 SimpleTreeModel(QObject *parent = 0);
00031 QVariant data(const QModelIndex &index, int role) const;
00032 Qt::ItemFlags flags(const QModelIndex &index) const;
00033 QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
00034 QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
00035 QModelIndex parent(const QModelIndex &index) const;
00036 int rowCount(const QModelIndex &parent = QModelIndex()) const;
00037 int columnCount(const QModelIndex &parent = QModelIndex()) const;
00038 Node* getItem(const QModelIndex &index) const;
00039
00040 private:
00041 Node *rootItem;
00042 };
00043
00044 #endif // SIMPLETREEMODEL_H
00045
00046