Unsolved QML form
-
Good afternoon.
How to correctly create a form on a qml of this kind?
Now I'm creating this way, but it's not correct as I understand it and will look incorrect at different resolutions
RowLayout { x: 29 y: 51 width: 598 height: 40 Label { id: label111 text: qsTr("Наименование объекта :") Layout.fillWidth: true } TextField { id: edit_name width: 400 height: 20 text: qsTr("") font.pointSize: 12 scale: 0.7 placeholderText: "Введите наименование объекта" } }```
-
@fender Hi,
Try like this :
Column { id:_root height: parent.height * 0.8 width: parent.width * 0.8 anchors.centerIn: parent spacing: 5 RowLayout { spacing: 5 Layout.preferredHeight: 25 Layout.fillHeight: false Layout.fillWidth: true Label { Layout.fillHeight: false Layout.fillWidth: false Layout.preferredHeight: 25 Layout.preferredWidth: _root.width*0.3 text: "TestTest" } TextField{ Layout.fillHeight: false Layout.fillWidth: true Layout.preferredWidth: _root.width*0.7 text: "red" } } RowLayout { spacing: 5 Layout.preferredHeight: 25 Layout.fillHeight: false Layout.fillWidth: true Label { Layout.fillHeight: false Layout.fillWidth: false Layout.preferredHeight: 25 Layout.preferredWidth: _root.width*0.3 text: "TestTestTestTest" } TextField{ Layout.fillHeight: false Layout.fillWidth: true Layout.preferredWidth: _root.width*0.7 text: "red" } } RowLayout { spacing: 5 Layout.preferredHeight: 25 Layout.fillHeight: false Layout.fillWidth: true Text { Layout.fillHeight: false Layout.fillWidth: false Layout.preferredHeight: 25 Layout.preferredWidth: _root.width*0.7 text: "rTestTestTestTestTestTestTestTested" } TextField{ Layout.fillHeight: false Layout.fillWidth: true Layout.preferredWidth: _root.width*0.3 text: "red" } } }