comparison data/model/ModelDataTableModel.h @ 416:a00902d5f0ab

* basics of data editing in data table view
author Chris Cannam
date Mon, 09 Jun 2008 16:01:50 +0000
parents 0b274e1aaf10
children 64e7bbb255d3
comparison
equal deleted inserted replaced
415:e37e44681720 416:a00902d5f0ab
17 #define _MODEL_DATA_TABLE_MODEL_H_ 17 #define _MODEL_DATA_TABLE_MODEL_H_
18 18
19 #include <QAbstractItemModel> 19 #include <QAbstractItemModel>
20 20
21 #include "Model.h" 21 #include "Model.h"
22
23 class Command;
22 24
23 class ModelDataTableModel : public QAbstractItemModel 25 class ModelDataTableModel : public QAbstractItemModel
24 { 26 {
25 Q_OBJECT 27 Q_OBJECT
26 28
43 QModelIndex parent(const QModelIndex &index) const; 45 QModelIndex parent(const QModelIndex &index) const;
44 46
45 int rowCount(const QModelIndex &parent = QModelIndex()) const; 47 int rowCount(const QModelIndex &parent = QModelIndex()) const;
46 int columnCount(const QModelIndex &parent = QModelIndex()) const; 48 int columnCount(const QModelIndex &parent = QModelIndex()) const;
47 49
50 QModelIndex getModelIndexForFrame(size_t frame) const;
51
48 static bool canHandleModelType(Model *); 52 static bool canHandleModelType(Model *);
53
54 signals:
55 void frameSelected(size_t);
56 void executeCommand(Command *);
49 57
50 protected slots: 58 protected slots:
51 void modelChanged(); 59 void modelChanged();
52 void modelChanged(size_t, size_t); 60 void modelChanged(size_t, size_t);
53 61
59 67
60 Model *m_model; 68 Model *m_model;
61 69
62 void rebuildRowVector(); 70 void rebuildRowVector();
63 template <typename PointType> void rebuildRowVectorSparse(); 71 template <typename PointType> void rebuildRowVectorSparse();
64 template <typename PointType> QVariant dataSparse(int row, int col) const; 72 template <typename PointType> QVariant dataSparse(int row, int col,
73 bool withUnit) const;
74 template <typename PointType> bool setDataSparse(int row, int col,
75 QVariant value);
65 }; 76 };
66 77
67 #endif 78 #endif