diff options
author | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2016-09-29 19:46:32 +0200 |
---|---|---|
committer | Paolo Angelelli <paolo.angelelli@qt.io> | 2016-10-05 15:44:27 +0000 |
commit | 0624390ef163f352903029f24c51b66f31aced46 (patch) | |
tree | 33cd6aca1f0b2d0ff8f100f5d7298b9be8972993 /src/imports | |
parent | bfba4efe54e838fe9ac48a85db314743680f576f (diff) | |
download | qtlocation-0624390ef163f352903029f24c51b66f31aced46.tar.gz |
Fix panActive state when last touch point is released
When a touch interaction ends, the map would only consider the number of
points, not their state. Thus when pan was active, it would always stay
active, because in the release event, the number of points is still at
least one.
This also requires a reset of the synthetic mouse point, since otherwise the mouse
point will be copied into the list of touch points, preventing the
number of points to ever go down to zero.
Change-Id: I9821d09d75f883d01eb38b741e2b5658036be334
Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
Diffstat (limited to 'src/imports')
-rw-r--r-- | src/imports/location/qquickgeomapgesturearea.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/imports/location/qquickgeomapgesturearea.cpp b/src/imports/location/qquickgeomapgesturearea.cpp index 9541355c..ccf360aa 100644 --- a/src/imports/location/qquickgeomapgesturearea.cpp +++ b/src/imports/location/qquickgeomapgesturearea.cpp @@ -672,8 +672,13 @@ void QQuickGeoMapGestureArea::handleTouchUngrabEvent() void QQuickGeoMapGestureArea::handleTouchEvent(QTouchEvent *event) { m_touchPoints.clear(); - for (int i = 0; i < event->touchPoints().count(); ++i) - m_touchPoints << event->touchPoints().at(i); + m_mousePoint.reset(); + + for (int i = 0; i < event->touchPoints().count(); ++i) { + auto point = event->touchPoints().at(i); + if (point.state() != Qt::TouchPointReleased) + m_touchPoints << point; + } if (event->touchPoints().count() >= 2) event->accept(); else |