summaryrefslogtreecommitdiff
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-26 16:06:22 +0200
commita94cefd446dd192172f47f183b56bbb719e95ee4 (patch)
tree72ec1bbe76da490919ee2756e1a02418b7d2a378
parent51d434233e245cefa0f4cff4d539add5e3923969 (diff)
downloadqtlocation-a94cefd446dd192172f47f183b56bbb719e95ee4.tar.gz
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>
-rw-r--r--src/location/quickmapitems/qdeclarativegeomap.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/location/quickmapitems/qdeclarativegeomap.cpp b/src/location/quickmapitems/qdeclarativegeomap.cpp
index 0823772c..117f7713 100644
--- a/src/location/quickmapitems/qdeclarativegeomap.cpp
+++ b/src/location/quickmapitems/qdeclarativegeomap.cpp
@@ -2543,19 +2543,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;
}