Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
None
-
None
Description
When you have a bunch of "sections" represented by e.g. GroupBoxes to create a sort of form layout, you generally want to align the first column:
import QtQuick import QtQuick.Controls import QtQuick.Layouts ApplicationWindow { width: 300 height: 300 visible: true ColumnLayout { anchors.fill: parent GroupBox { title: qsTr("Dialog properties") Layout.fillWidth: true GridLayout { columns: 2 anchors.fill: parent Label { text: qsTr("modality") Layout.alignment: Qt.AlignTop Layout.minimumWidth: ApplicationWindow.window.width * 0.2 Layout.maximumWidth: ApplicationWindow.window.width * 0.2 } CheckBox { } } } GroupBox { title: qsTr("FileDialog properties") Layout.fillWidth: true GridLayout { columns: 2 anchors.fill: parent Label { text: qsTr("acceptLabel") Layout.minimumWidth: ApplicationWindow.window.width * 0.2 Layout.maximumWidth: ApplicationWindow.window.width * 0.2 } TextField { id: acceptLabelTextField text: qsTr("OK") } } } } }
The first column should use the largest implicit width (here I hard-coded it for the sake of the example). That could be done via e.g. QTBUG-44078 or some other API.
The second column should take the remaining space, but the items within it shouldn't fill; they should be left-aligned.
Expected:
Actual:
Attachments
Issue Links
- relates to
-
QTBUG-44078 Feature request: LayoutGroup
- Reported