Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
None
-
5.6.1, 5.7.0, 5.8.0
-
None
-
Linux 64bit
Description
If I have a layout with four visible items, each item can be hidden without a problem.
If one of the items is initially hidden however, the layouting fails afterwards in setting an appropriate size for that item if it is about to be shown.
Here is code to demonstrate the problem. I used the Controls 2 template from Qt Creator and changed the QML file to:
import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 ApplicationWindow { visible: true width: 800 height: 250 title: qsTr("Layout Test") Column { RowLayout { height: 200 width: 800 Rectangle { Layout.fillHeight: true Layout.fillWidth: true visible: first.checked color: "plum" } Rectangle { Layout.fillHeight: true Layout.fillWidth: true visible: second.checked color: "teal" } Rectangle { Layout.fillHeight: true Layout.fillWidth: true visible: third.checked color: "salmon" } Rectangle { Layout.fillHeight: true Layout.fillWidth: true visible: fourth.checked color: "steelblue" } } RowLayout { height: 50 width: 800 CheckBox { id: first checked: true text: "Show First" } CheckBox { id: second checked: true text: "Show Second" } CheckBox { id: third checked: true // <-- Change to false to see the problem text: "Show Third" } CheckBox { id: fourth checked: true text: "Show Fourth" } } } }
Attachments
Issue Links
- duplicates
-
QTBUG-54319 QML Layout does not scale children correctly when they are initially hidden
- Closed