Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.0, 5.15.1, 5.15.2, 5.15.3
-
-
a6705dc99a81b7eab35db61957963d375e723fce (qt/tqtc-qtdeclarative/5.15)
Description
Description
The attached projects and video shows that an Image painted with the wrong Z order thus painted over children or siblings.
Steps to reproduce
Click the second button (the one in the middle) and the third one (the one at the bottom).
The image is painted over its sibling or children
Reporter Notes
- I tested the problem both on Windows and Linux X11 with Qt 5.15.2
- The problem is both visibile with image siblings or children. In the attached example i provided two qml files (main.qml` and `main.qml2`). The first qml is for siblings and the second is for children
Item { width: 150; height: 50 Image { width: parent.width objectName: "item1" source: selectedItem == objectName ? "qrc:/long-bckg-btn-selected.png" : "qrc:/long-bckg-btn-unselected.png" } Text { anchors.centerIn: parent color: "white" } MouseArea { anchors.fill: parent onClicked: selectedItem = "item1" } } vs Image { objectName: "item1" source: selectedItem == objectName ? "qrc:/long-bckg-btn-selected.png" : "qrc:/long-bckg-btn-unselected.png" width: 150 Text { text: "" anchors.centerIn: parent color: "white" } MouseArea { anchors.fill: parent onClicked: selectedItem = "item1" } }
- Maybe there's some kind of connection with the "cache" property because settings it to false seems to "hide" the problem
Image {
...
cache: false
}