diff options
Diffstat (limited to 'examples/tutorials/modelview/5_edit/mymodel.h')
-rwxr-xr-x[-rw-r--r--] | examples/tutorials/modelview/5_edit/mymodel.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/examples/tutorials/modelview/5_edit/mymodel.h b/examples/tutorials/modelview/5_edit/mymodel.h index 0d2a1b8..574808e 100644..100755 --- a/examples/tutorials/modelview/5_edit/mymodel.h +++ b/examples/tutorials/modelview/5_edit/mymodel.h @@ -44,7 +44,11 @@ //! [Quoting ModelView Tutorial] // mymodel.h #include <QAbstractTableModel> -#include <QStringList> +#include <QString> + +const int COLS= 3; +const int ROWS= 2; + class MyModel : public QAbstractTableModel { @@ -57,8 +61,7 @@ public: bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole); Qt::ItemFlags flags(const QModelIndex & index) const ; private: - QStringList m_gridData; //holds text entered into QTableView - int modelIndexToOffset(const QModelIndex & index) const; + QString m_gridData[ROWS][COLS]; //holds text entered into QTableView signals: void editCompleted(const QString &); }; |