Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.0.0
-
None
Description
The red rectangle in the middle is drawn even if its visible property is false.
Steps to reproduce:
1. Press the blue rectangle on the top left
-> Both blue and red rectangle disappear as expected
2. Press the red rectangle on the top right
-> Red rectangle's "show" property is set false
3. Press the blue rectangle on the top left again
-> Both blue and red rectangles are shown even though red rectangle's visible property is false!
import QtQuick 2.0 Rectangle { width: 230 height: 300 Rectangle { x: 10; y: 10 width: 100; height: 50 color: "blue" Text { anchors { top: parent.top; topMargin: 5; horizontalCenter: parent.horizontalCenter } text: a.visible ? "visible" : "invisible" } MouseArea { anchors.fill: parent onClicked: a.visible = !a.visible } } Rectangle { x: 120; y: 10 width: 100; height: 50 color: "red" Text { id: text1 anchors { top: parent.top; topMargin: 5; horizontalCenter: parent.horizontalCenter } text: b.visible ? "visible" : "invisible" } Text { anchors { top: text1.bottom; topMargin: 5; horizontalCenter: parent.horizontalCenter } text: b.show ? "show" : "noshow" } MouseArea { anchors.fill: parent onClicked: b.show = !b.show } } Rectangle { id: a color: "blue" anchors.centerIn: parent width: 100; height: 100 Rectangle { id: b property bool show: true visible: show color: "red" anchors.centerIn: parent width: 50; height: 50 } } }