aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickdrawer.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-09-06 09:21:15 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-09-06 15:20:10 +0000
commit9ae57848671419b2622e254af8642fef7b1b7c33 (patch)
treed25df980ee418ecd2fe09312873b42ab8691f677 /src/quicktemplates2/qquickdrawer.cpp
parentbc0fdae8fad4e199792b3f00ebcb74bd80473227 (diff)
QQuickDrawer: fix the internal transition state
When QQuickDrawer was visible all the time, it did not emit the visibility related signals at all. Now the signals are emitted, but aboutToShow() and visibleChanged() were emitted twice when a drawer was manually dragged open. First time when the dragging begins (the drawer becomes effectively visible), and second time when the open transition begins after mouse/touch release. This change ensures that the signals won't be emitted again when the transition begins, in case they were already emitted. Change-Id: I2a175c9e86a480d5cd23e306f41f0d85e2416f75 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickdrawer.cpp')
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index 44fc8f50..15b53914 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -360,28 +360,18 @@ static QList<QQuickStateAction> prepareTransition(QQuickDrawer *drawer, QQuickTr
return actions;
}
-void QQuickDrawerPrivate::prepareEnterTransition(bool notify)
+bool QQuickDrawerPrivate::prepareEnterTransition()
{
Q_Q(QQuickDrawer);
enterActions = prepareTransition(q, enter, 1.0);
- QQuickPopupPrivate::prepareEnterTransition(notify);
+ return QQuickPopupPrivate::prepareEnterTransition();
}
-void QQuickDrawerPrivate::prepareExitTransition()
+bool QQuickDrawerPrivate::prepareExitTransition()
{
Q_Q(QQuickDrawer);
exitActions = prepareTransition(q, exit, 0.0);
- QQuickPopupPrivate::prepareExitTransition();
-}
-
-void QQuickDrawerPrivate::finalizeEnterTransition()
-{
- QQuickPopupPrivate::finalizeEnterTransition();
-}
-
-void QQuickDrawerPrivate::finalizeExitTransition(bool hide)
-{
- QQuickPopupPrivate::finalizeExitTransition(hide);
+ return QQuickPopupPrivate::prepareExitTransition();
}
QQuickDrawer::QQuickDrawer(QObject *parent) :