00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00027 #ifndef MODEL_CLASS_TREE_MODEL_H
00028 #define MODEL_CLASS_TREE_MODEL_H
00029
00030 #include <QAbstractItemModel>
00031 #include <QModelIndex>
00032 #include <QVariant>
00033 #include "inspectorj/client/sessionprofile.h"
00034 #include "inspectorj/model/javaclass.h"
00035
00036 namespace inspectorj {
00037 namespace model {
00038
00045 class TreeItem;
00046 class ClassTreeModel : public QAbstractItemModel
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 ClassTreeModel(QObject *parent = 0);
00052 ~ClassTreeModel();
00053
00054 QVariant data(const QModelIndex &index, int role) const;
00055 Qt::ItemFlags flags(const QModelIndex &index) const;
00056 QVariant headerData(int section, Qt::Orientation orientation,
00057 int role = Qt::DisplayRole) const;
00058 QModelIndex index(int row, int column,
00059 const QModelIndex &parent = QModelIndex()) const;
00060 QModelIndex parent(const QModelIndex &index) const;
00061 int rowCount(const QModelIndex &parent = QModelIndex()) const;
00062 int columnCount(const QModelIndex &parent = QModelIndex()) const;
00063 void setJavaClass(JavaClass*);
00064
00065 public slots:
00066 void initModel();
00067
00068 private:
00069 void setupModelData(TreeItem *parent);
00070 JavaClass *javaClass;
00071 TreeItem *rootItem;
00072 };
00073
00074 }
00075 }
00076
00077 #endif // MODEL_CLASS_TREE_MODEL_H