diff options
author | Roland Wolf <ext-roland.wolf@nokia.com> | 2010-07-29 11:51:27 (GMT) |
---|---|---|
committer | Roland Wolf <ext-roland.wolf@nokia.com> | 2010-07-29 11:51:27 (GMT) |
commit | da7f8a556c122a31daa11f434d67c8bb96cbd5ec (patch) | |
tree | 28d906d034d20c9079cebb75d08bb60bc4d1b8d4 /examples/tutorials/modelview/5_edit/mymodel.h | |
parent | 65642dd343bf61510117cd7e13f69e7138247932 (diff) | |
download | Qt-da7f8a556c122a31daa11f434d67c8bb96cbd5ec.zip Qt-da7f8a556c122a31daa11f434d67c8bb96cbd5ec.tar.gz Qt-da7f8a556c122a31daa11f434d67c8bb96cbd5ec.tar.bz2 |
moving over work from 28b49e42f5bddec2d62e957f158cb848da134db8
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 &); }; |