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

ColumnLayout incorrectly exposes attached properties

    XMLWordPrintable

Details

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

    Description

      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.

       

      Attachments

        1. ColumnLayoutBug.zip
          2 kB
          Martin Leutelt

        Issue Links

          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
              mleutelt Martin Leutelt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes