summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLauri Laanmets <lauri.laanmets@eesti.ee>2022-05-22 14:37:44 +0300
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-09-27 15:46:17 +0200
commita7d97ca9b05b8078f00767f844044ed0de333a6a (patch)
treeb5236a163e836202227641728c8fc386156da483
parent19bdb8d7dba356cde332830569ba17ef093cfc63 (diff)
Improve QEvent::UngrabMouse handling in map gesture area
Replace deprecated QQuickWindow::mouseGrabberItem() check and pass on all QEvent::UngrabMouse events into general 'QQuickGeoMapGestureArea::handleTouchEvent' handler. This will handle 'exclusiveGrabber' and 'QEventPoint::Released' events separately for all points. This will now correctly handle the situation where child MouseArea: 1. Grabs first touch point with 'press and hold' 2. Second finger is pressed. 3. First finger is released and 'ungrabbed'. 4. Second finger will start panning the map. Task-number: QTBUG-96795 Change-Id: Ieb3418787e89aadd1a7c0c8ab9b1f965a4484c24 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a94cefd446dd192172f47f183b56bbb719e95ee4)
-rw-r--r--src/location/declarativemaps/qdeclarativegeomap.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/location/declarativemaps/qdeclarativegeomap.cpp b/src/location/declarativemaps/qdeclarativegeomap.cpp
index 8a153deb..38c554f4 100644
--- a/src/location/declarativemaps/qdeclarativegeomap.cpp
+++ b/src/location/declarativemaps/qdeclarativegeomap.cpp
@@ -2575,19 +2575,9 @@ bool QDeclarativeGeoMap::childMouseEventFilter(QQuickItem *item, QEvent *event)
}
}
break;
- case QEvent::UngrabMouse: {
- QQuickWindow *win = window();
- if (!win) break;
- if (!win->mouseGrabberItem() ||
- (win->mouseGrabberItem() &&
- win->mouseGrabberItem() != this)) {
- // child lost grab, we could even lost
- // some events if grab already belongs for example
- // in item in diffrent window , clear up states
- mouseUngrabEvent();
- }
- break;
- }
+ case QEvent::UngrabMouse:
+ Q_ASSERT(event->isSinglePointEvent());
+ return sendTouchEvent(static_cast<QSinglePointEvent*>(event));
default:
break;
}