diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-10-20 21:48:28 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-12 13:01:30 +0000 |
commit | 8c685b765bf4ceba3c4cf8fdd9c9d680f338b7a9 (patch) | |
tree | 51c5eafe87638e79961c63898cc63bce87edcadd /examples/widgets/itemviews/chart/pieview.h | |
parent | 1c957bb8e57adf7674716f40b67c5d6877b32f86 (diff) |
Itemviews: Cleanup examples
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 <aha_1980@gmx.de>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'examples/widgets/itemviews/chart/pieview.h')
-rw-r--r-- | examples/widgets/itemviews/chart/pieview.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/widgets/itemviews/chart/pieview.h b/examples/widgets/itemviews/chart/pieview.h index aa397e6d55..22c74dde81 100644 --- a/examples/widgets/itemviews/chart/pieview.h +++ b/examples/widgets/itemviews/chart/pieview.h @@ -59,7 +59,7 @@ class PieView : public QAbstractItemView Q_OBJECT public: - PieView(QWidget *parent = 0); + PieView(QWidget *parent = nullptr); QRect visualRect(const QModelIndex &index) const override; void scrollTo(const QModelIndex &index, ScrollHint hint = EnsureVisible) override; @@ -100,13 +100,13 @@ private: int rows(const QModelIndex &index = QModelIndex()) const; void updateGeometries() override; - int margin; - int totalSize; - int pieSize; - int validItems; - double totalValue; + int margin = 0; + int totalSize = 300; + int pieSize = totalSize - 2 * margin; + int validItems = 0; + double totalValue = 0.0; + QRubberBand *rubberBand = nullptr; QPoint origin; - QRubberBand *rubberBand; }; //! [0] |