I would like to dispatch my onPressed event to subsequent objects in my QML tree, (I have indicate mouse.accepted = false and propagateComposedEvents: true ) but I want to keep the onreleased event working on the top level element .. Here the code :
Item {
width: 200
height: 200
Rectangle {
z: 1
anchors.fill: parent
MouseArea{
anchors.fill: parent
propagateComposedEvents: true
onPressed: {
console.log("R1 pressed")
mouse.accepted = false
}
onReleased: {
console.log("R1 released")
mouse.accepted = false
}
}
}
Rectangle {
z: 0
anchors.fill: parent
MouseArea{
anchors.fill: parent
propagateComposedEvents: true
onPressed: {
console.log("R2 pressed")
}
onReleased: {
console.log("R2 released")
}
}
}
}
What I expect to see :
qml: R1 pressed qml: R2 pressed qml: R1 released qml: R2 released
What I get :
qml: R1 pressed qml: R2 pressed qml: R2 released
How can I solve that ?
Thanks in advance for your help .