aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2020-09-18 13:05:56 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2020-09-18 12:56:46 +0000
commit1e8d3ffa5fb95699d18af5639ffeb90054b71856 (patch)
treefea76e7de00347b59d16353decb905eb9b8cde17
parent59aaf903cc54a7cfba00ec3859ca59292f4cbf4a (diff)
Don't trigger a close due to a release if we did not get a press
If the drawer does not see the press point then it was not open at the time it was pressed. This ensures that when a touch is done on a button to trigger the opening of a drawer it does not think it should be closed due to the default close policy. Change-Id: I0d1b11341e659dc14554d0d72aac70199bbb99fa Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit d3cc8710bc6175e5e7562ba171bd32dfc4d224b7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--src/quicktemplates2/qquickdrawer.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp
index cf2f7558..6f804546 100644
--- a/src/quicktemplates2/qquickdrawer.cpp
+++ b/src/quicktemplates2/qquickdrawer.cpp
@@ -482,6 +482,8 @@ bool QQuickDrawerPrivate::handleMove(QQuickItem *item, const QPointF &point, ulo
bool QQuickDrawerPrivate::handleRelease(QQuickItem *item, const QPointF &point, ulong timestamp)
{
+ if (pressPoint.isNull())
+ return false;
if (!popupItem->keepMouseGrab() && !popupItem->keepTouchGrab()) {
velocityCalculator.reset();
return QQuickPopupPrivate::handleRelease(item, point, timestamp);