Qt 6.11 is out! See what's new in the release
blog
Struggle with SplitView
-
Following is a split view with forms on the left "panel" and a rectangle serving as main area on the right.
import QtQuick import QtQuick.Controls import QtQuick.Layouts ApplicationWindow { visible: true minimumWidth: 640 minimumHeight: 480 SplitView { anchors.fill: parent anchors.margins: 10 ScrollView { ColumnLayout { GroupBox { title: "Form 1" Layout.fillWidth: true GridLayout { columns: 2 Text { text: "Lorem:" } TextField { } Text { text: "Foo:" } ComboBox { } } } /* Spacer */ Item { Layout.fillWidth: true Layout.fillHeight: true } GroupBox { title: "Form 2" Layout.fillWidth: true GridLayout { columns: 2 Text { text: "Bar:" } RowLayout { TextField { } Button { text: "Yes" } } Text { text: "Ipsum:" } TextField { } } } } } Rectangle { color: "navajowhite" Layout.fillWidth: true Layout.fillHeight: true } } }This has currently many issues which I'm not sure how to approach:
- Dragging the vertical split to the left causes a scroll to appear (which is expected), but dragging it to the right doesn't cause the group boxes to expand (the
fillWidth: trueseems to only work for the initial state). - The spacer between the forms has no effect: I was expecting it to push the 2nd form down to the bottom of the window (it works if I remove the
ScrollView) - I can't find a way for the
margins: 10to work within each side of the split view (having that property in theScrollViewand theRectanglehas no effect)
- Dragging the vertical split to the left causes a scroll to appear (which is expected), but dragging it to the right doesn't cause the group boxes to expand (the