Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-92984

Image is painted with wrong Z order

    XMLWordPrintable

Details

    • Linux/X11, Windows
    • 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
      } 

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            cuke Filippo Cucchetto
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes