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

    • Windows
    • d12c195b138a087444890ccd59c65a07825af5e4, afeef10c82927a65f59bf59f4c5121dfcb68799e

    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

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

        Activity

          People

            pandaras Panajotis Daras
            mikio_hirai Mikio Hirai
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes