-
Bug
-
Resolution: Fixed
-
P1: Critical
-
None
-
6.4.1
-
None
Starting with 6.4.1 (possibly 6.4.0 too, haven't checked) I'm seeing some odd behaviour regarding nested ColumnLayouts in combination with Layout.preferredWidth.
ColumnLayout
{
anchors.fill: parent
ColumnLayout
{
Rectangle
{
id: mainRect
Layout.preferredWidth: 160
Layout.fillHeight: true
color: "blue"
}
Rectangle
{
onWidthChanged: console.log("green rect", width);
implicitWidth: mainRect.width
implicitHeight: 10
color: "green"
}
Rectangle
{
onWidthChanged: console.log("red rect", width);
implicitWidth: mainRect.width
implicitHeight: 10
color: "red"
}
}
}
On 6.3.2 I see this:

qml: green rect 160 qml: red rect 160
On 6.4.1, this is the situation:

qml: green rect 160 qml: red rect 160 qml: red rect 0
It doesn't make sense that the red rectangle is a different width to the green one, given their implicitWidth bindings being identical. Nor is it clear why its width gets set correctly initially, and is then zeroed.
Interestingly, if I replace
Layout.preferredWidth: 160
...with...
implicitWidth: 160
I get the 6.3.x behaviour.
- is covered by
-
QTBUG-111792 Dynamically changing the Items in a ColumnLayout while resizing leads to crash
-
- Closed
-