diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-05-10 21:08:37 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-05-15 17:21:49 +0000 |
commit | 2c6d20245cfaaa8d62874df98beb49c99d0067bc (patch) | |
tree | 8ec25363db181b570bed720955741a8d734e200f /src/quick | |
parent | 92269400ed1876b0ea1e87571cfa6281edcad7d3 (diff) |
TapHandler: don't give up passive grab on setPressed(false)
If a button with a TapHandler with the DragThreshold policy is inside
a Flickable, and you press on the button and start dragging, when you
exceed the drag threshold, TapHandler will not "want" the EventPoint
anymore. That triggers it to call setPressed(false). Flickable does
not have a grab because it was relying on filtering the children's
events; and QQuickWindow does not deliver touch updates to non-grabber
items. So when TapHandler gives up its passive grab, Flickable does
not get a chance to filter TapHandler's touch update events anymore.
Thus, we cannot do that. When the touchpoint is actually released
though, passive grabs are ungrabbed anyway.
This is required to get the new
tst_FlickableInterop::touchDragFlickableBehindButton()
autotest working.
Change-Id: I55a175ae358f75b9d7ab64f0b8124d91b6a9e1d6
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/handlers/qquicktaphandler.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/quick/handlers/qquicktaphandler.cpp b/src/quick/handlers/qquicktaphandler.cpp index c0a0dd8379..f79dbb266a 100644 --- a/src/quick/handlers/qquicktaphandler.cpp +++ b/src/quick/handlers/qquicktaphandler.cpp @@ -291,12 +291,9 @@ void QQuickTapHandler::setPressed(bool press, bool cancel, QQuickEventPoint *poi } } emit pressedChanged(); - if (!press) { + if (!press && m_gesturePolicy != DragThreshold) { // on release, ungrab after emitting changed signals - if (m_gesturePolicy == DragThreshold) - setPassiveGrab(point, press); - else - setExclusiveGrab(point, press); + setExclusiveGrab(point, press); } } } |