Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.13.0
-
None
-
Dell XPS 15 9560, Windows 10
Description
Example code:
import QtQuick 2.13 import QtQuick.Controls 2.13 ApplicationWindow { visible: true width: 640 height: 480 Repeater { model: 2 Rectangle { y: index === 1 ? 30 : 0 width: 200 height: 60 color: tapHandler.pressed ? "yellow" : (dragHandler.active ? "red" : "grey") opacity: 0.7 Label { text: "%1".arg(index) font.pixelSize: 30 } TapHandler { id: tapHandler //grabPermissions: PointerHandler.ApprovesTakeOverByHandlersOfDifferentType onTapped: { console.debug("onTapped:", index) //eventPoint.accepted = true; } } DragHandler { id: dragHandler } } } }
Steps to reproduce of the problem:
- Tap in the place where both rectangles overlap
- Signal onTapped will be emitted for both TapHandlers
I tried to find a solution without using any workarounds (e.g. modal layer under each of the rectangles), but unfortunately without success. Regardless of the grabPolicy used or attempts to accept the event in onTapped, tapped signal will be emitted for both TapHandlers.
I know that TapHandler with gesturePolicy: TapHandler.DragThreshold takes no excusives grab, but it would be useful to have some possibility to control the logic in the example above. We want to share grab with DragHandler and not with another TapHandler in this case.
Attachments
Issue Links
- relates to
-
QTBUG-68075 DragHandler: need the ability to start dragging after a long press
- Reported