aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickmousearea.cpp
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2019-10-10 16:51:13 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2019-12-02 16:34:34 +0200
commit23df1603f514407d245a2740f32f589318ef654e (patch)
tree97cf8d44b40919ece6033dfc2e12e4c97fa78bb5 /src/quick/items/qquickmousearea.cpp
parent991035ea1f00671d79c340a8a5c038e6aae1ece7 (diff)
MouseArea: react to touch ungrab
If an event handler (such as DragHandler) takes the exclusive grab of a touchpoint that MouseArea had already grabbed as a synth-mouse, it should react in the same way as if its grab of the actual mouse was stolen: release the pressed state, etc. Fixes: QTBUG-77624 Change-Id: I51f4fb253f7d0377be421c23e617942507616e72 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick/items/qquickmousearea.cpp')
-rw-r--r--src/quick/items/qquickmousearea.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp
index ddf34798d7..368379f5c4 100644
--- a/src/quick/items/qquickmousearea.cpp
+++ b/src/quick/items/qquickmousearea.cpp
@@ -942,6 +942,12 @@ void QQuickMouseArea::mouseUngrabEvent()
ungrabMouse();
}
+void QQuickMouseArea::touchUngrabEvent()
+{
+ // allow a Pointer Handler to steal the grab from MouseArea
+ ungrabMouse();
+}
+
bool QQuickMouseArea::sendMouseEvent(QMouseEvent *event)
{
Q_D(QQuickMouseArea);