diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2018-05-03 11:23:56 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2018-05-04 12:53:00 +0000 |
commit | aea55d29d2555c5649c13d3bc11bde4799c6bac5 (patch) | |
tree | 52434edff3041005f98b6899566fce119855efae /src/quicktemplates2/qquickpageindicator.cpp | |
parent | a5d2731b1ec56580a79784759307d3b3c21ab87f (diff) |
Templates: use C++11 default member initialization
The code is more readable and less error-prone (this patch caught a few
uninitialized members) when the members are initialized in the same
place where they are declared. In many cases, empty default destructors
can be entirely removed, and we get faster implicitly declared inline
default constructors defined by the compiler.
Change-Id: I14c5448afc901f9b2ac5965f28c1c26c0b646c08
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickpageindicator.cpp')
-rw-r--r-- | src/quicktemplates2/qquickpageindicator.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/quicktemplates2/qquickpageindicator.cpp b/src/quicktemplates2/qquickpageindicator.cpp index df720c91..dd90402e 100644 --- a/src/quicktemplates2/qquickpageindicator.cpp +++ b/src/quicktemplates2/qquickpageindicator.cpp @@ -89,15 +89,6 @@ class QQuickPageIndicatorPrivate : public QQuickControlPrivate, public QQuickIte Q_DECLARE_PUBLIC(QQuickPageIndicator) public: - QQuickPageIndicatorPrivate() - : count(0), - currentIndex(0), - interactive(false), - delegate(nullptr), - pressedItem(nullptr) - { - } - void handlePress(const QPointF &point) override; void handleMove(const QPointF &point) override; void handleRelease(const QPointF &point) override; @@ -109,11 +100,11 @@ public: void itemChildAdded(QQuickItem *, QQuickItem *child) override; - int count; - int currentIndex; - bool interactive; - QQmlComponent *delegate; - QQuickItem *pressedItem; + int count = 0; + int currentIndex = 0; + bool interactive = false; + QQmlComponent *delegate = nullptr; + QQuickItem *pressedItem = nullptr; }; void QQuickPageIndicatorPrivate::handlePress(const QPointF &point) |