Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.5.1
-
None
-
PC MinGW QT5.5.1
Description
I have a RowLayout with multiple children which I want evenly distributed over the available space. Some of these are initially hidden and will be shown at runtime.
Example scenario:
2 rectangles, 'blue' one initially hidden. Clicking on the 'red' one makes the 'blue' rectangle visible.
Expected: Both rectangles should then evenly use the space.
Actual: Only 'red' rectangle is visible + spacing. 'Blue' rectangle remains hidden.
RowLayout { anchors.fill: parent Rectangle { id: rect1 Layout.fillWidth: true Layout.fillHeight: true color: "red" MouseArea { anchors.fill: parent onClicked: { rect2.visible = !rect2.visible } } } Rectangle { id: rect2 Layout.fillWidth: true Layout.fillHeight: true color: "blue" visible: false } }
Setting preferredWidth on both as suggested here https://bugreports.qt.io/browse/QTBUG-43261 does not help.
Attached is example code, click on red rectangle to try make the blue one visible (which won't work).
Attachments
Issue Links
- is duplicated by
-
QTBUG-57455 Layout broken if one item is initially hidden
- Closed