Propagate mouse events to items bellow a MouseArea instance
-
Hello all!
Given: Some QML items(let it be Rectangles for simplicity), MouseArea which fills all QML items occupied space.
Goal: Handle mouse clicking on the top MouseArea and in the below Rectangles.
A little scratch:
@import QtQuick 1.0Item{
width: 100
height: 100
Rectangle{
anchors.fill: parent
color: "yellow"
MouseArea{
anchors.fill: parent
onClicked: parent.color = "red"
}
}
MouseArea{
z: 1
anchors.fill: parent
onClicked: mouse.accepted = false
}
}@According to the scratch I want the Rectangle turns to the red colour. How can I achieve that?
-
It was discussed couple of times here at DevNet and also you can find an "issue":http://bugreports.qt.nokia.com/browse/QTBUG-15900 in bugtracker.
UPD: Another "issue":http://bugreports.qt.nokia.com/browse/QTBUG-13007 in bugtracker. Also couple of topics:
-
Thank you Denis. But it is a little strange that trolls react so slow on that bug. In according to the bug report it has already took 2 months but it still wasn't evaluated.
Besides, what did the developers mean by the MouseEvent.accepted property if it has never worked. -
You can find a possible workaround in second issue I've mentiond in my comment. Maybe it will help you.
-
It is getting more clear. "This":http://bugreports.qt.nokia.com/browse/QTBUG-13007 bug report is more appropriate to the case. Obviously, until the bug(feature) is not fixed it should be documented because accepted property is confusing.