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

ColumnLayout incorrectly exposes attached properties

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P1: Critical P1: Critical
    • None
    • 5.12.1
    • None
    • Windows

      It seems that some but not all attached properties in a ColumnLayout can be accessed by child elements, which can lead to layouts simply breaking silently.

      Consider the following code:

      ColumnLayout { 
          id: column
          anchors.fill: parent  
          Repeater { 
              model: 3 
              delegate: Rectangle { 
                  Layout.fillWidth: true 
                  Layout.fillHeight: true 
                  color: Qt.rgba(Math.random(), Math.random(), Math.random())  
                  Component.onCompleted: console.log("completed", column, row, maximumHeight, maximumWidth, minimumHeight, minimumWidth) 
              } 
          } 
      }
      

      An access to the ColumnLayout by its id isn't possible from inside Rectangle, since 'column' seems to refer to the attached property 'column' from ColumnLayout, which should normally be accessed though 'Layout.column'.

      Example code is attached.

       

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

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            mleutelt Martin Leutelt
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes