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

Weird layout behavior

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.12.12, 6.4.2
    • Quick: Layouts
    • None

      In my example, Rectangle's Layout.fillHeight is completely ignored because of TextArea's Layout.fillHeight while TextArea is NOT on the same level as Rectangle and should not affect the Rectangle in any way.

      import QtQuick 2.12
      import QtQuick.Window 2.12
      import QtQuick.Controls 2.12
      import QtQuick.Layouts 1.12
      Window {
          width: 640
          height: 480
          visible: true
          title: qsTr("Hello World")
          ColumnLayout {
              anchors.fill: parent
              Rectangle {
                  color: "blue"
                  Layout.fillWidth: true
                  Layout.preferredHeight: 50
              }
              RowLayout {
                  Layout.fillWidth: true
                  Layout.preferredHeight: 50
                  Label {
                      text: "INPUT:"
                  }
                  TextArea {
                      Layout.fillWidth: true // CULPRIT
                      Layout.fillHeight: true // CULPRIT
                  }
              }
              Rectangle {
                  color: "black"
                  Layout.fillWidth: true
                  Layout.fillHeight: true
              }
          }
      }
      

        1. bug.png
          bug.png
          4 kB
        2. expected.png
          expected.png
          4 kB
        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
            alervd Alexander Dyagilev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes