summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2018-03-07 14:51:37 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2018-03-16 20:37:20 +0000
commit5af3f07c95e758636090ad4a928fa8e86a7b2dc6 (patch)
tree6cb2c7ea8358473d5379ba89196fa9868ce82a2f
parent7ad0349c3be792c5ef55f6d1bbf9cb5870d102a0 (diff)
downloadqtlocation-5af3f07c95e758636090ad4a928fa8e86a7b2dc6.tar.gz
Don't start panning on mouse release
Task-number: QTBUG-66534 Change-Id: I72aee2235c50273fde809e67c83e0c2195db88b4 Reviewed-by: Paolo Angelelli <paolo.angelelli@qt.io>
-rw-r--r--src/location/declarativemaps/qquickgeomapgesturearea.cpp3
-rw-r--r--tests/auto/declarative_ui/tst_map_mouse.qml10
2 files changed, 12 insertions, 1 deletions
diff --git a/src/location/declarativemaps/qquickgeomapgesturearea.cpp b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
index 1703bcfa..43041da4 100644
--- a/src/location/declarativemaps/qquickgeomapgesturearea.cpp
+++ b/src/location/declarativemaps/qquickgeomapgesturearea.cpp
@@ -1722,7 +1722,8 @@ void QQuickGeoMapGestureArea::panStateMachine()
*/
bool QQuickGeoMapGestureArea::canStartPan()
{
- if (m_allPoints.count() == 0 || (m_acceptedGestures & PanGesture) == 0)
+ if (m_allPoints.count() == 0 || (m_acceptedGestures & PanGesture) == 0
+ || m_mousePoint->state() == Qt::TouchPointReleased) // mouseReleaseEvent handling does not clear m_mousePoint, only ungrabMouse does -- QTBUG-66534
return false;
// Check if thresholds for normal panning are met.
diff --git a/tests/auto/declarative_ui/tst_map_mouse.qml b/tests/auto/declarative_ui/tst_map_mouse.qml
index 07ef949f..e5294f67 100644
--- a/tests/auto/declarative_ui/tst_map_mouse.qml
+++ b/tests/auto/declarative_ui/tst_map_mouse.qml
@@ -669,6 +669,16 @@ Item {
compare(mouseOverlapperDoubleClickedSpy.count, 4)
}
+ function test_release_does_not_block_clicked() { // QTBUG-66534
+ clear_data()
+ mousePress(map, 55, 75)
+ compare(mouseOverlapperPressedSpy.count, 1)
+ mouseRelease(map, 55, 25)
+ compare(mouseOverlapperReleasedSpy.count, 1)
+ mouseClick(map, 25, 25)
+ compare(mouseUpperClickedSpy.count, 1)
+ }
+
function test_zzz_basic_press_and_hold() { // _zzz_ to ensure execution last (takes time)
clear_data();
wait(1000);