From 8c685b765bf4ceba3c4cf8fdd9c9d680f338b7a9 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 20 Oct 2018 21:48:28 +0200 Subject: Itemviews: Cleanup examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cleanup some minor issues in the chart example: - remove unused members - use initializer list for members - pass a proper role to dataChanged() - honor roles parameter in PieView::dataChanged() - use nullptr instead 0 - use new-style connect - fix indentation and other whitespaces Change-Id: Idb212b07c006fe3ae31bee9cd9b1ba4d03043b5e Reviewed-by: André Hartmann Reviewed-by: Paul Wicking --- examples/widgets/tutorials/modelview/5_edit/mymodel.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/widgets/tutorials/modelview/5_edit/mymodel.h') diff --git a/examples/widgets/tutorials/modelview/5_edit/mymodel.h b/examples/widgets/tutorials/modelview/5_edit/mymodel.h index dd0d4f5066..ce462351af 100644 --- a/examples/widgets/tutorials/modelview/5_edit/mymodel.h +++ b/examples/widgets/tutorials/modelview/5_edit/mymodel.h @@ -64,12 +64,12 @@ class MyModel : public QAbstractTableModel { Q_OBJECT public: - MyModel(QObject *parent); - int rowCount(const QModelIndex &parent = QModelIndex()) const override ; + MyModel(QObject *parent = nullptr); + int rowCount(const QModelIndex &parent = QModelIndex()) const override; int columnCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; - bool setData(const QModelIndex & index, const QVariant & value, int role = Qt::EditRole) override; - Qt::ItemFlags flags(const QModelIndex & index) const override ; + bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; + Qt::ItemFlags flags(const QModelIndex &index) const override; private: QString m_gridData[ROWS][COLS]; //holds text entered into QTableView signals: -- cgit v1.2.3