I have a QML component with buttons, ... in it. I put a MouseArea which covers this entire component because I need to execute an action wherever I click on the component. However, I also want to execute the action behind the MouseArea.
For example, if I click on a button in the component, I want to execute the MouseArea action and then the button action.
Item {
Button{
anchors: ...
onClicked: console.info("Button clicked")
}
MouseArea{
anchors.fill: parent
propagateComposedEvents: true
onClicked: console.info("MouseArea clicked")
}
}
If propagateComposedEvents: true, then MouseArea onClicked is not executed, but Button onClicked is. If false, MouseArea is executed but not Button onClicked.
I want to have both MouseArea (first) and Button (second) signal onClicked to be executed.
buttonId.clicked()
in reaction to the clicked-signal of theMouseArea