piplex
5th March 2015, 10:19
Hello all,
MouseArea of blueRectangle is disabled.
When blueRectangle is clicked , yellowRectangle receives onClicked. Why is this happening ?
How can I do when MouseArea of blueRectangle is disabled and I clicked on this the yellowRectangle does not receives onClicked.
Rectangle {
id: yellowRectangle
color: "yellow"
width: 100; height: 100
MouseArea {
anchors.fill: parent
onClicked: console.log("clicked yellow")
}
Rectangle {
id: blueRectangle
color: "blue"
width: 50; height: 50
MouseArea {
anchors.fill: parent
enabled: false
onClicked: {
console.log("clicked blue")
mouse.accepted = false
}
}
}
}
MouseArea of blueRectangle is disabled.
When blueRectangle is clicked , yellowRectangle receives onClicked. Why is this happening ?
How can I do when MouseArea of blueRectangle is disabled and I clicked on this the yellowRectangle does not receives onClicked.
Rectangle {
id: yellowRectangle
color: "yellow"
width: 100; height: 100
MouseArea {
anchors.fill: parent
onClicked: console.log("clicked yellow")
}
Rectangle {
id: blueRectangle
color: "blue"
width: 50; height: 50
MouseArea {
anchors.fill: parent
enabled: false
onClicked: {
console.log("clicked blue")
mouse.accepted = false
}
}
}
}