From aea55d29d2555c5649c13d3bc11bde4799c6bac5 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 3 May 2018 11:23:56 +0200 Subject: 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 --- src/quicktemplates2/qquickmenubar_p_p.h | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/quicktemplates2/qquickmenubar_p_p.h') diff --git a/src/quicktemplates2/qquickmenubar_p_p.h b/src/quicktemplates2/qquickmenubar_p_p.h index 161806fb..b6fdc9eb 100644 --- a/src/quicktemplates2/qquickmenubar_p_p.h +++ b/src/quicktemplates2/qquickmenubar_p_p.h @@ -61,8 +61,6 @@ class Q_QUICKTEMPLATES2_PRIVATE_EXPORT QQuickMenuBarPrivate : public QQuickConta Q_DECLARE_PUBLIC(QQuickMenuBar) public: - QQuickMenuBarPrivate(); - static QQuickMenuBarPrivate *get(QQuickMenuBar *menuBar) { return menuBar->d_func(); @@ -92,13 +90,13 @@ public: static QQuickMenu *menus_at(QQmlListProperty *prop, int index); static void menus_clear(QQmlListProperty *prop); - bool popupMode; - bool triggering; - bool hasContentWidth; - bool hasContentHeight; - qreal contentWidth; - qreal contentHeight; - QQmlComponent *delegate; + bool popupMode = false; + bool triggering = false; + bool hasContentWidth = false; + bool hasContentHeight = false; + qreal contentWidth = 0; + qreal contentHeight = 0; + QQmlComponent *delegate = nullptr; QPointer currentItem; }; -- cgit v1.2.3