diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-09-18 21:59:48 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-09-26 09:56:23 +0200 |
commit | 0bd86b0e2ee67c3f99b8a9712c743c25c8be39b8 (patch) | |
tree | 6b5f7c898366871cf65ae30c5ca943a45e5c9d47 /src/quick/items/qquickanimatedsprite_p_p.h | |
parent | 26e5788a273b8614e9b9e701d29a7b6c77adacc0 (diff) |
Handle ungrab and grab-cancel consistently; inform handlers
Call onGrabChanged on Pointer Handlers during grab transitions:
this was missing in a97759a336c597327cb82eebc9f45c793aec32c9.
Flickable needs to receive an ungrab by child-event-filtering,
in order to set its pressed state back to false (as in the
cancelOnHide autotest). This is best done as a result of the
QPointingDevice::grabChanged signal, while trying to send the ungrab
to the item that was the grabber, rather than as a special case.
Thus, QQuickWindowPrivate::onGrabChanged (the handler for the
QPointingDevice::grabChanged signal) is now the only place from which
we call QQuickItem::mouseUngrabEvent() and touchUngrabEvent().
But the result is that they are called in more cases than before,
so some tests need adjustment. touchUngrabEvent() is not sent
unless the event is available and we can verify that all points
have been released. This is important for MultiPointTouchArea:
it will react by ending interaction with all points at once.
Another thing that's important to MPTA and multi-touch handlers is that
QQuickWindowPrivate::deliverPointerEvent() must not clear grabbers of
points that are not yet released, in the case that only some points are.
QQuickWindowPrivate::removeGrabber() now calls
QPointingDevicePrivate::removeGrabber() with its optional cancel
argument, so that it will emit either a cancel or an ungrab transition.
That's only relevant for Pointer Handlers, whereas QQuickItem
mouseUngrabEvent and touchUngrabEvent don't make a distinction.
Task-number: QTBUG-86729
Change-Id: Idf03aef2e2182398e0fc4a606c0ddbb2aaed5681
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/quick/items/qquickanimatedsprite_p_p.h')
0 files changed, 0 insertions, 0 deletions