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

RowLayout added with Repeater in ColumnLayout has non-functional Layout.fillWidth

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.10.0
    • Quick: Layouts
    • None

    Description

      When adding a RowLayout directly to a ColumnLayout via a Repeater, at least Layout.fillWidth is ignored on the RowLayout items.

      Which seems a bug. In comparison, when creating the RowLayout via a Loader the property Layout.fillWidth works. The property Layout.fillWidth also works if adding a Item directly via a Repeater.

      Showcase:

      import QtQuick 2.9
      
      import QtQuick.Layouts 1.3
      
      ColumnLayout {
          id: root
      
          property var someModel: [ "A" ]
          width: 800
      
          Repeater {
              model: root.someModel
      
              delegate: Item {
                  Layout.fillWidth: true
                  Text {
                      anchors.centerIn: parent
                      text: "With Item: Takes the whole width"
                  }
              }
          }
      
          Repeater {
              model: root.someModel
      
              delegate: RowLayout {
                  Layout.fillWidth: true 
                  Text {
                      Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
                      text: "With RowLayout: Does not take the whole width"
                  }
              }
          }
      
          Repeater {
              model: root.someModel
      
              delegate: Loader {
                  Layout.fillWidth: item.Layout.fillWidth
                  sourceComponent: RowLayout {
                      Layout.fillWidth: true 
                      Text {
                          Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
                          text: "With Loader and RowLayout: takes the whole width"
                      }
                  }
              }
          }
      }
      
      

      Attachments

        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
            kossebau Friedrich W. H. Kossebau
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes