diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2016-08-10 11:37:13 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2016-08-12 16:53:26 +0000 |
commit | 7d632386da4a6ee1634ba85316054ac8813f300e (patch) | |
tree | f62307ae3d472c118a7389753008d04864f1ccd8 /src | |
parent | 963fe911fb16d4e6dd184704351b4a488c41be24 (diff) |
QDeclarativeGeoMap::sendTouchEvent: fix compilation
Commit eb238e2cf9013f9a6cd20af0a59180896abdc377 got rid of
QQuickWindowPrivate::itemForTouchPointId by keeping track of the
grabbers in the event points.
Task-number: QTBUG-55229
Change-Id: Icc4bcc987937ee299a47d8aa43147adc53369f47
Reviewed-by: Paolo Angelelli <paolo.angelelli@theqtcompany.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/location/qdeclarativegeomap.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/imports/location/qdeclarativegeomap.cpp b/src/imports/location/qdeclarativegeomap.cpp index 9bb8a17a..1a624e15 100644 --- a/src/imports/location/qdeclarativegeomap.cpp +++ b/src/imports/location/qdeclarativegeomap.cpp @@ -1495,9 +1495,16 @@ bool QDeclarativeGeoMap::sendMouseEvent(QMouseEvent *event) bool QDeclarativeGeoMap::sendTouchEvent(QTouchEvent *event) { - QQuickWindowPrivate *win = window() ? QQuickWindowPrivate::get(window()) : 0; + const QQuickPointerDevice *touchDevice = QQuickPointerDevice::touchDevice(event->device()); const QTouchEvent::TouchPoint &point = event->touchPoints().first(); - QQuickItem *grabber = win ? win->itemForTouchPointId.value(point.id()) : 0; + + auto touchPointGrabberItem = [touchDevice](const QTouchEvent::TouchPoint &point) -> QQuickItem* { + if (QQuickEventPoint *eventPointer = touchDevice->pointerEvent()->pointById(point.id())) + return eventPointer->grabber(); + return nullptr; + }; + + QQuickItem *grabber = touchPointGrabberItem(point); bool stealEvent = m_gestureArea->isActive(); bool containsPoint = contains(mapFromScene(point.scenePos())); @@ -1509,7 +1516,7 @@ bool QDeclarativeGeoMap::sendTouchEvent(QTouchEvent *event) m_gestureArea->handleTouchEvent(touchEvent.data()); stealEvent = m_gestureArea->isActive(); - grabber = win ? win->itemForTouchPointId.value(point.id()) : 0; + grabber = touchPointGrabberItem(point); if (grabber && stealEvent && !grabber->keepTouchGrab() && grabber != this) { QVector<int> ids; @@ -1531,7 +1538,7 @@ bool QDeclarativeGeoMap::sendTouchEvent(QTouchEvent *event) } if (event->type() == QEvent::TouchEnd) { - if (win && win->itemForTouchPointId.value(point.id()) == this) { + if (touchPointGrabberItem(point) == this) { ungrabTouchPoints(); } } |