aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickpopup_p_p.h
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-05-03 11:23:56 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2018-05-04 12:53:00 +0000
commitaea55d29d2555c5649c13d3bc11bde4799c6bac5 (patch)
tree52434edff3041005f98b6899566fce119855efae /src/quicktemplates2/qquickpopup_p_p.h
parenta5d2731b1ec56580a79784759307d3b3c21ab87f (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/qquickpopup_p_p.h')
-rw-r--r--src/quicktemplates2/qquickpopup_p_p.h91
1 files changed, 46 insertions, 45 deletions
diff --git a/src/quicktemplates2/qquickpopup_p_p.h b/src/quicktemplates2/qquickpopup_p_p.h
index 6890fdac..318ae598 100644
--- a/src/quicktemplates2/qquickpopup_p_p.h
+++ b/src/quicktemplates2/qquickpopup_p_p.h
@@ -77,7 +77,7 @@ protected:
void finished() override;
private:
- QQuickPopupPrivate *popup;
+ QQuickPopupPrivate *popup = nullptr;
};
class Q_AUTOTEST_EXPORT QQuickPopupPrivate : public QObjectPrivate, public QQuickItemChangeListener
@@ -86,7 +86,6 @@ class Q_AUTOTEST_EXPORT QQuickPopupPrivate : public QObjectPrivate, public QQuic
public:
QQuickPopupPrivate();
- ~QQuickPopupPrivate();
static QQuickPopupPrivate *get(QQuickPopup *popup)
{
@@ -142,50 +141,52 @@ public:
NoTransition, EnterTransition, ExitTransition
};
- bool focus;
- bool modal;
- bool dim;
- bool hasDim;
- bool visible;
- bool complete;
- bool positioning;
- bool hasWidth;
- bool hasHeight;
- bool hasTopMargin;
- bool hasLeftMargin;
- bool hasRightMargin;
- bool hasBottomMargin;
- bool allowVerticalFlip;
- bool allowHorizontalFlip;
- bool allowVerticalMove;
- bool allowHorizontalMove;
- bool allowVerticalResize;
- bool allowHorizontalResize;
- bool hadActiveFocusBeforeExitTransition;
- bool interactive;
- bool hasClosePolicy;
- int touchId;
- qreal x;
- qreal y;
- qreal effectiveX;
- qreal effectiveY;
- qreal margins;
- qreal topMargin;
- qreal leftMargin;
- qreal rightMargin;
- qreal bottomMargin;
- qreal contentWidth;
- qreal contentHeight;
+ static const QQuickPopup::ClosePolicy DefaultClosePolicy;
+
+ bool focus = false;
+ bool modal = false;
+ bool dim = false;
+ bool hasDim = false;
+ bool visible = false;
+ bool complete = true;
+ bool positioning = false;
+ bool hasWidth = false;
+ bool hasHeight = false;
+ bool hasTopMargin = false;
+ bool hasLeftMargin = false;
+ bool hasRightMargin = false;
+ bool hasBottomMargin = false;
+ bool allowVerticalFlip = false;
+ bool allowHorizontalFlip = false;
+ bool allowVerticalMove = true;
+ bool allowHorizontalMove = true;
+ bool allowVerticalResize = true;
+ bool allowHorizontalResize = true;
+ bool hadActiveFocusBeforeExitTransition = false;
+ bool interactive = true;
+ bool hasClosePolicy = false;
+ int touchId = -1;
+ qreal x = 0;
+ qreal y = 0;
+ qreal effectiveX = 0;
+ qreal effectiveY = 0;
+ qreal margins = -1;
+ qreal topMargin = 0;
+ qreal leftMargin = 0;
+ qreal rightMargin = 0;
+ qreal bottomMargin = 0;
+ qreal contentWidth = 0;
+ qreal contentHeight = 0;
QPointF pressPoint;
- TransitionState transitionState;
- QQuickPopup::ClosePolicy closePolicy;
- QQuickItem *parentItem;
- QQuickItem *dimmer;
- QQuickWindow *window;
- QQuickTransition *enter;
- QQuickTransition *exit;
- QQuickPopupItem *popupItem;
- QQuickPopupPositioner *positioner;
+ TransitionState transitionState = NoTransition;
+ QQuickPopup::ClosePolicy closePolicy = DefaultClosePolicy;
+ QQuickItem *parentItem = nullptr;
+ QQuickItem *dimmer = nullptr;
+ QQuickWindow *window = nullptr;
+ QQuickTransition *enter = nullptr;
+ QQuickTransition *exit = nullptr;
+ QQuickPopupItem *popupItem = nullptr;
+ QQuickPopupPositioner *positioner = nullptr;
QList<QQuickStateAction> enterActions;
QList<QQuickStateAction> exitActions;
QQuickPopupTransitionManager transitionManager;