diff options
author | Seokha Ko <seokha.ko@qt.io> | 2022-09-02 18:10:08 +0900 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-09-15 00:40:58 +0000 |
commit | 1c039962a6265709b76406e8334c3fa7d1e62aba (patch) | |
tree | b3ca019a2d2e8d178a92a5731bad271bdb5a36be /src/quick | |
parent | 8818b7d7f84fca082067aca2afc5a10964a9991b (diff) |
PinchArea: Keep the touch/mouse grab when pinch activated
Keep the touch/mouse grab when pinch activated to prevent
childMouseEventFilter of parent from stealing the event
Amends 10800723ab6dacf1203986a6b0815dec45528ef4
Fixes: QTBUG-105058
Change-Id: I6589b7d9cc5cc51ffe5dcaac137d1608604db572
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
(cherry picked from commit 4461dfc06b4b1b4bd97a0972ca10a1ab4d53a4c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/items/qquickpincharea.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/quick/items/qquickpincharea.cpp b/src/quick/items/qquickpincharea.cpp index afadf713b8..3065f627af 100644 --- a/src/quick/items/qquickpincharea.cpp +++ b/src/quick/items/qquickpincharea.cpp @@ -442,6 +442,7 @@ void QQuickPinchArea::updatePinch(QTouchEvent *event, bool filtering) if (d->touchPoints.count() < 2) { // A pinch gesture is not occurring, so stealing the grab is permitted. setKeepTouchGrab(false); + setKeepMouseGrab(false); // During filtering, there's no need to hold a grab for one point, // because filtering happens for every event anyway. // But if we receive the event via direct delivery, and give up the grab, @@ -465,6 +466,7 @@ void QQuickPinchArea::updatePinch(QTouchEvent *event, bool filtering) pe.setStartPoint2(mapFromScene(d->sceneStartPoint2)); pe.setPoint1(mapFromScene(d->lastPoint1)); pe.setPoint2(mapFromScene(d->lastPoint2)); + setKeepTouchGrab(false); setKeepMouseGrab(false); emit pinchFinished(&pe); d->pinchStartDist = 0; @@ -502,6 +504,8 @@ void QQuickPinchArea::updatePinch(QTouchEvent *event, bool filtering) d->initPinch = true; event->setExclusiveGrabber(touchPoint1, this); event->setExclusiveGrabber(touchPoint2, this); + setKeepTouchGrab(true); + setKeepMouseGrab(true); } if (d->pinchActivated && !d->pinchRejected) { const int dragThreshold = QGuiApplication::styleHints()->startDragDistance(); |