diff options
| author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-02-02 21:08:44 +0100 |
|---|---|---|
| committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-02-05 17:06:43 +0000 |
| commit | 076087717e4b6ee0953902b24676e54a73ff5fff (patch) | |
| tree | a5a8d60941e561a48dad473e5eb3a61c776fadbd /src/widgets/doc/snippets/common-table-model/model.h | |
| parent | a0717c60b30be5f7aa4c9dcde06a42f9ee532f0f (diff) | |
Documentation: Update CommonTableModel/StringListModel snippets
Update CommonTableModel/StringListModel snippets:
- 0 -> nullptr
- use 'override'
- replace "" with QString()
- use QStringLiteral instead QString
- pass role to dataChanged() signal
Change-Id: I5949d1bd6fee3186f12191f1f6235ae18908096e
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/widgets/doc/snippets/common-table-model/model.h')
| -rw-r--r-- | src/widgets/doc/snippets/common-table-model/model.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/widgets/doc/snippets/common-table-model/model.h b/src/widgets/doc/snippets/common-table-model/model.h index 68e6c007020..5f152e0e78b 100644 --- a/src/widgets/doc/snippets/common-table-model/model.h +++ b/src/widgets/doc/snippets/common-table-model/model.h @@ -60,22 +60,22 @@ class TableModel : public QAbstractTableModel Q_OBJECT public: - TableModel(int rows = 1, int columns = 1, QObject *parent = 0); + TableModel(int rows = 1, int columns = 1, QObject *parent = nullptr); - int rowCount(const QModelIndex &parent = QModelIndex()) const; - int columnCount(const QModelIndex &parent = QModelIndex()) const; - QVariant data(const QModelIndex &index, int role) const; + int rowCount(const QModelIndex &parent = QModelIndex()) const override; + int columnCount(const QModelIndex &parent = QModelIndex()) const override; + QVariant data(const QModelIndex &index, int role) const override; QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; + int role = Qt::DisplayRole) const override; - Qt::ItemFlags flags(const QModelIndex &index) const; + Qt::ItemFlags flags(const QModelIndex &index) const override; bool setData(const QModelIndex &index, const QVariant &value, - int role = Qt::EditRole); + int role = Qt::EditRole) override; - bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex()); - bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex()); - bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex()); - bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex()); + bool insertRows(int position, int rows, const QModelIndex &parent = QModelIndex()) override; + bool insertColumns(int position, int columns, const QModelIndex &parent = QModelIndex()) override; + bool removeRows(int position, int rows, const QModelIndex &parent = QModelIndex()) override; + bool removeColumns(int position, int columns, const QModelIndex &parent = QModelIndex()) override; private: QList<QStringList> rowList; |
