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/itemviews/chart/mainwindow.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'examples/widgets/itemviews/chart/mainwindow.h') diff --git a/examples/widgets/itemviews/chart/mainwindow.h b/examples/widgets/itemviews/chart/mainwindow.h index 058f5c7e90..51176d261b 100644 --- a/examples/widgets/itemviews/chart/mainwindow.h +++ b/examples/widgets/itemviews/chart/mainwindow.h @@ -56,7 +56,6 @@ QT_BEGIN_NAMESPACE class QAbstractItemModel; class QAbstractItemView; -class QItemSelectionModel; QT_END_NAMESPACE class MainWindow : public QMainWindow @@ -64,7 +63,7 @@ class MainWindow : public QMainWindow Q_OBJECT public: - MainWindow(); + MainWindow(QWidget *parent = nullptr); private slots: void openFile(); @@ -75,9 +74,8 @@ private: void setupViews(); void loadFile(const QString &path); - QAbstractItemModel *model; - QAbstractItemView *pieChart; - QItemSelectionModel *selectionModel; + QAbstractItemModel *model = nullptr; + QAbstractItemView *pieChart = nullptr; }; #endif // MAINWINDOW_H -- cgit v1.2.3