ui/qt/model.h

changeset 69
419c8c3209e8
parent 58
2b124f8ebd95
child 72
a00b46d92c54
--- a/ui/qt/model.h	Fri Jan 09 14:33:40 2015 +0100
+++ b/ui/qt/model.h	Sat Jan 10 10:14:28 2015 +0100
@@ -32,19 +32,34 @@
 #include "toolkit.h"
 #include "../ui/tree.h"
 #include "../common/context.h"
+#include <QTreeView>
 #include <QAbstractTableModel>
+#include <QAbstractItemModel>
+#include <QItemSelectionModel>
 
 class TableModel : public QAbstractTableModel {
     Q_OBJECT
     
+    UiObject    *obj;
     UiListPtr   *list;
     UiModelInfo *info;
+    QTreeView   *view;
 public:
-    TableModel(UiListPtr *list, UiModelInfo *info);
+    TableModel(UiObject *obj, QTreeView *view, UiListPtr *list, UiModelInfo *info);
     
     int rowCount(const QModelIndex &parent = QModelIndex()) const ;
     int columnCount(const QModelIndex &parent = QModelIndex()) const;
     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+
+private:
+    UiListSelection* listSelection();
+    
+public slots:
+    void selectionChanged(
+        const QItemSelection & selected,
+        const QItemSelection & deselected);
+    void activate(const QModelIndex &);
 };
 
 #endif	/* MODEL_H */

mercurial