aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shaw <andy.shaw@qt.io>2018-12-05 13:33:31 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2018-12-19 16:42:25 +0000
commitd6e560c356791d516856c38566104fbb2bb6c730 (patch)
tree667c5bbc216e144ee6e6ab95185da950f276a7ed
parentc401ae278b4bb91c70c6d7df974a241d7c68855b (diff)
When there are no points to grab, then we should return false
If there are no points to grab then it should not indicate that it was able to grab points. Otherwise it can cause a handler to be active when it has not valid points to work with. This can happen if you do a pinch gesture on a DragHandler as the points are not valid by default then. Fixes: QTBUG-71972 Change-Id: Ib1c48e5a3777f4118944accfa2bc92edf0209884 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
-rw-r--r--src/quick/handlers/qquickmultipointhandler.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/quick/handlers/qquickmultipointhandler.cpp b/src/quick/handlers/qquickmultipointhandler.cpp
index 2f4e9d45e9..228c99bb12 100644
--- a/src/quick/handlers/qquickmultipointhandler.cpp
+++ b/src/quick/handlers/qquickmultipointhandler.cpp
@@ -309,6 +309,8 @@ void QQuickMultiPointHandler::acceptPoints(const QVector<QQuickEventPoint *> &po
bool QQuickMultiPointHandler::grabPoints(QVector<QQuickEventPoint *> points)
{
+ if (points.isEmpty())
+ return false;
bool allowed = true;
for (QQuickEventPoint* point : points) {
if (point->exclusiveGrabber() != this && !canGrab(point)) {