ui/qt/model.h

changeset 69
419c8c3209e8
parent 58
2b124f8ebd95
child 72
a00b46d92c54
equal deleted inserted replaced
68:bd9fb6476b80 69:419c8c3209e8
30 #define MODEL_H 30 #define MODEL_H
31 31
32 #include "toolkit.h" 32 #include "toolkit.h"
33 #include "../ui/tree.h" 33 #include "../ui/tree.h"
34 #include "../common/context.h" 34 #include "../common/context.h"
35 #include <QTreeView>
35 #include <QAbstractTableModel> 36 #include <QAbstractTableModel>
37 #include <QAbstractItemModel>
38 #include <QItemSelectionModel>
36 39
37 class TableModel : public QAbstractTableModel { 40 class TableModel : public QAbstractTableModel {
38 Q_OBJECT 41 Q_OBJECT
39 42
43 UiObject *obj;
40 UiListPtr *list; 44 UiListPtr *list;
41 UiModelInfo *info; 45 UiModelInfo *info;
46 QTreeView *view;
42 public: 47 public:
43 TableModel(UiListPtr *list, UiModelInfo *info); 48 TableModel(UiObject *obj, QTreeView *view, UiListPtr *list, UiModelInfo *info);
44 49
45 int rowCount(const QModelIndex &parent = QModelIndex()) const ; 50 int rowCount(const QModelIndex &parent = QModelIndex()) const ;
46 int columnCount(const QModelIndex &parent = QModelIndex()) const; 51 int columnCount(const QModelIndex &parent = QModelIndex()) const;
47 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; 52 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
53 QVariant headerData(int section, Qt::Orientation orientation, int role) const;
54
55 private:
56 UiListSelection* listSelection();
57
58 public slots:
59 void selectionChanged(
60 const QItemSelection & selected,
61 const QItemSelection & deselected);
62 void activate(const QModelIndex &);
48 }; 63 };
49 64
50 #endif /* MODEL_H */ 65 #endif /* MODEL_H */
51 66

mercurial