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

Image is painted with wrong Z order

    XMLWordPrintable

    Details

    • Platform/s:
      Linux/X11, Windows
    • Commits:
      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

        For Gerrit Dashboard: QTBUG-92984
        # Subject Branch Project Status CR V

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            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