Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-137

Z values below 0 don't stack below the parent, as opposed to the documentation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt for MCUs 2.3.1
    • Documentation, QML
    • None
    • Windows

    Description

      The document(https://doc.qt.io/QtForMCUs-2.3/qtquick-visualcanvas-visualparent.html#stacking-order) says something like this.

      Z values below 0 will stack below the parent,

      {}However, the code below proves otherwise. In the code, the red rectangle has z as -10, which is smaller than the z value of the green rectangle(parent). If the documentation is true, the red rectangle should be stacked below the parent(green rectangle).

      import QtQuick 2.0
      Rectangle {
          color: "#272822"
          width: 320
          height: 480
          z:10    
          Rectangle {
              y: 64
              z: 3
              width: 256
              height: 256
              color: "green"        
              Rectangle {
                  x: 192
                  y: 64
                  z: -10
                  width: 128
                  height: 128
                  color: "red"
              }
          }    
          Rectangle {
              x: 64
              y: 192
              z: 2
              width: 256
              height: 256
              color: "blue"
          }
      } 

      Here is the output. The red rectangle is stacked above the parent(green rectangle).

      Attachments

        Activity

          People

            Unassigned Unassigned
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: