Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.7.1, 6.7.2
-
None
Description
Using Layout.fillWidth true on the contents of a StackLayout which has index greater than zero (that is, not the default index) and the contents are nested in another layout (e.g. ColumnLayout) results in bad computation of the initial width when the StackLayout index is switched to e.g. with a TabBar. The attached Qt for Python example can be used to reproduce this behavior:
- In a fresh Python virtual environment, install PySide6 6.7.1 or 6.7.2 using pip
- Run qml_test.py to display the test application.
- Note that on the initial load, the first TabBar/StackLayout index is selected and the red rectangle fills the window as expected
- Click Tab 2 to activate it and note that the window does not show a green rectangle filling the area as expected
- Resize the window e.g. by dragging the right edge of the window and note that once the window repaints the green rectangle now fills the window area as expected.
- Tab 3 shows a similar behavior with a GroupBox with Layout.fillWidth true, as another example.
- (Optional) replace PySide6 with version 6.7.0 and note that this version produces the expected behavior (switching to Tab 2 immediately shows the green rectangle or Tab 3 the group box at full width as expected).
The QML for the example is embedded in the Python script. I have attached a separate identical version as view.qml.