Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.2.4, 6.3.0
-
None
Description
When inside a Control, TapHandler will detect press and release but will not emit any tap related event.
The DragHandler will detect a drag but active leep oscillating between true and false.
Sample code:
import QtQml import QtQuick import QtQuick.Controls import QtQuick.Layouts Control { height: 40 background: Rectangle { color: 'red' } contentItem: RowLayout { height: 40 spacing: 50 Control { id: control height:40 implicitWidth: 50 Layout.fillWidth: true Layout.fillHeight: true contentItem: Item {} background: Rectangle { color: 'blue' } color: 'yellow' TapHandler { acceptedButtons: Qt.LeftButton onSingleTapped: (eventPoint) => { console.log('single tapped left'); } onTapped: (eventPoint) => { console.log('tapped left'); } onPressedChanged: console.log("pressed left " + pressed + tapCount) } DragHandler { onActiveChanged: console.log("drag active: " + active) target: null } } Label { id: label width: 100 Layout.fillWidth: true Layout.fillHeight: true text: "bar" background: Rectangle { color: 'green' } TapHandler { acceptedButtons: Qt.LeftButton onSingleTapped: (eventPoint) => { console.log('single tapped left'); } onTapped: (eventPoint) => { console.log('tapped left'); } onPressedChanged: console.log("pressed left " + pressed + tapCount) } DragHandler { onActiveChanged: console.log("drag active: " + active) target: null } } } }
Expected bahviour
When interecting with label we have the expected behaviour.
When clicking the logs are:
qml: pressed left true0 qml: tapped left qml: single tapped left qml: pressed left false1
When dragging on the label the logs are:
qml: pressed left true1 qml: drag active: true qml: pressed left false1 qml: drag active: false
Observed behaviour
However, on control we have, for a click:
qml: pressed left true0 qml: pressed left false0
The tap signals are not emitted.
for a drag:
qml: pressed left true0 qml: drag active: true qml: pressed left false0 qml: drag active: false qml: drag active: true qml: drag active: false qml: drag active: true qml: drag active: false qml: drag active: true qml: drag active: false qml: drag active: true qml: drag active: false qml: drag active: true qml: drag active: false qml: drag active: true qml: drag active: false qml: drag active: true qml: drag active: false
The drag "restarts".
Attachments
Issue Links
- relates to
-
QTBUG-64491 need to be able to add PointerHandlers to conventional event-handling Items
- Reported