-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
6.9.3
-
None
I have several questions or even maybe bugs (I'm not sure).
1. The following code:
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
Window {
width: 640
height: 100
visible: true
title: qsTr("Hello World")
component R : Rectangle {
Layout.fillWidth: true
Layout.maximumWidth: 100
Layout.fillHeight: true
Layout.alignment: Qt.AlignLeft
}
RowLayout
{
width: parent.width
height: 100
spacing: 0
R { color: "red" }
R { color: "green" }
R { color: "blue" }
}
}
Produces the following:

Why are all these rectangles not aligned to the left as requested? I would expect it to produce the following instead:

Fow now, I have to use additional empty Item element (with Layout.fillWidth: true) to achieve this.
2. The following code:
import QtQuick import QtQuick.Controls import QtQuick.LayoutsWindow { width: 310 height: 100 visible: true title: qsTr("Hello World") component R : Rectangle { Layout.fillWidth: true Layout.maximumWidth: 100 Layout.fillHeight: true Layout.alignment: Qt.AlignLeft } RowLayout { width: parent.width height: 100 spacing: 0 R { color: "red" } R { color: "green" } R { color: "blue" } Item { Layout.fillWidth: true Layout.minimumWidth: 1 Layout.preferredWidth: 1 } } }
Produces this:

Why does the last element in the layout occupies so much space while I set preferred width to 1? It "eats" space from rectangles making them smaller then I would expect.