Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
5.12.0
-
None
-
a6e196ce9 (dev), ae7069bfa (6.5), dd3484343 (6.5.0), b0bb5823e (6.4), a8fb5c36c (tqtc/lts-6.2)
Description
It makes a huge difference which kind of grab TapHandler takes on press. We have found some scenarios when the default policy is best, so that the event continues to propagate: for example when adding a TapHandler to an Item that already handles some events in its own ways, it's good that TapHandler doesn't interfere with that item's event handling. So it can be used to augment existing behavior.
When using a TapHandler inside a Flickable, you might want it to take a passive grab, and while delivering subsequent move events, it then becomes important for Flickable to be able to continue filtering those, even though they are going to a handler rather than an Item (QTBUG-71918, QTBUG-73035). Or you might want it to take an exclusive grab, to avoid direct delivery of the press to the Flickable (because if that happens, the Flickable will take the exclusive grab right away).
gesturePolicy describes an aspect of behavior at a high level, and in order to achieve that behavior, it has to do its grabs differently. But when users already know that the problem is to control whether events should keep propagating or not, they don't expect to find it in this particular property. They may start messing around with grabPermissions (but it's better to reserve that as a "last resort"), and that doesn't fix this case generally.
So somehow we may need another property or flags to explicitly control event propagation.
Of course people are already used to the MouseArea way: onPressed: mouse.accepted = false. But we need a declarative way.
Attachments
Issue Links
- relates to
-
QTBUG-71918 if PointerHandlers are declared as direct children of Flickable (ListView, TableView etc.) they don't get events
- Closed
-
QTBUG-73035 TapHandler breaks ListView flicking on a touchscreen
- Closed
-
QTBUG-64491 need to be able to add PointerHandlers to conventional event-handling Items
- Reported
-
QTBUG-68103 add an Item.modal property to block event propagation
- Reported
-
QTBUG-70397 TapHandler fires for all overlapping items
- Reported
-
QTBUG-96030 TapHandler PassiveGrab prohibits event propagation to MouseArea click
- Reported
-
QTBUG-100534 TapHandler doesn't stop propagation
- Reported
-
QTBUG-94011 consider adding grabPermissions to Item
- Reported
- resulted in
-
QTBUG-65650 TapHandler events are not forwarded to Map
- Reported
Gerrit Reviews
For Gerrit Dashboard: QTBUG-73262 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
385031,2 | WIP PointerHandler: add acceptsEvents property | dev | qt/qtdeclarative | Status: ABANDONED | -2 | 0 |
461259,11 | doc: Add snippets and animations illustrating TapHandler.GesturePolicy | dev | qt/qtdeclarative | Status: MERGED | +2 | 0 |
463837,2 | doc: Add snippets and animations illustrating TapHandler.GesturePolicy | 6.5 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
463838,3 | doc: Add snippets and animations illustrating TapHandler.GesturePolicy | 6.4 | qt/qtdeclarative | Status: MERGED | +2 | 0 |
463840,5 | doc: Add snippets and animations illustrating TapHandler.GesturePolicy | tqtc/lts-6.2 | qt/tqtc-qtdeclarative | Status: MERGED | +2 | 0 |
464044,2 | doc: Add snippets and animations illustrating TapHandler.GesturePolicy | 6.5.0 | qt/qtdeclarative | Status: MERGED | +2 | 0 |