diff -r cf14046909cd -r 7ea31701156e treemodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/treemodel.h Tue Aug 05 07:36:53 2008 +0000 @@ -0,0 +1,34 @@ +#ifndef TREEMODEL_H +#define TREEMODEL_H + +#include +#include +#include + +class TreeItem; + +class TreeModel : public QAbstractItemModel +{ + Q_OBJECT + +public: + TreeModel(QObject *parent = 0); + ~TreeModel(); + + 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; + +private: + void setupModelData(TreeItem *parent); + + TreeItem *rootItem; +}; + +#endif