diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2022-07-27 19:44:30 +0800 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-08-16 10:41:23 +0000 |
commit | ae023ff2fc483e44d8aec80219ef0c79ae9cc687 (patch) | |
tree | 0de02bbd09f6d2831db1dd3e0f971cd97a42ecfd /src | |
parent | b34665b72a1eba757a4db39c8b7e31fb8736410c (diff) |
PinchArea: fix pinches being stolen when in PathView
Keep the mouse grab in addition to touch, as PathView
apparently doesn't deal with touch events yet.
Fixes: QTBUG-105058
Change-Id: Id94768aec847138cccdeccfa92e4bc72a19810fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 10800723ab6dacf1203986a6b0815dec45528ef4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickpincharea.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickpincharea.cpp b/src/quick/items/qquickpincharea.cpp index b6e22169b2..74f00c22b9 100644 --- a/src/quick/items/qquickpincharea.cpp +++ b/src/quick/items/qquickpincharea.cpp @@ -390,6 +390,7 @@ void QQuickPinchArea::clearPinch(QTouchEvent *event) } } setKeepTouchGrab(false); + setKeepMouseGrab(false); } void QQuickPinchArea::cancelPinch(QTouchEvent *event) @@ -431,6 +432,7 @@ void QQuickPinchArea::cancelPinch(QTouchEvent *event) event->setExclusiveGrabber(point, nullptr); } setKeepTouchGrab(false); + setKeepMouseGrab(false); } void QQuickPinchArea::updatePinch(QTouchEvent *event, bool filtering) @@ -463,6 +465,7 @@ void QQuickPinchArea::updatePinch(QTouchEvent *event, bool filtering) pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); pe.setPoint1(mapFromScene(d->lastPoint1)); pe.setPoint2(mapFromScene(d->lastPoint2)); + setKeepMouseGrab(false); emit pinchFinished(&pe); d->pinchStartDist = 0; d->pinchActivated = false; @@ -561,6 +564,9 @@ void QQuickPinchArea::updatePinch(QTouchEvent *event, bool filtering) event->setExclusiveGrabber(touchPoint1, this); event->setExclusiveGrabber(touchPoint2, this); setKeepTouchGrab(true); + // So that PinchArea works in PathView, grab mouse events too. + // We should be able to remove these setKeepMouseGrab calls when QTBUG-105567 is fixed. + setKeepMouseGrab(true); d->inPinch = true; if (d->pinch && d->pinch->target()) { auto targetParent = pinch()->target()->parentItem(); |