I try to add cells to my GridLayout
by using a Repeater
. My data is stored in a model and containing two properties per element:
Title
Value
My goal is to get a GridLayout
containing the Title
in first cell and the Value
in the second cell of each row.
GridLayout {
id: someId
columns: 2
rowSpacing: 5
columnSpacing: 5
anchors.margins: 5
anchors.left: parent.left
anchors.right: parent.right
Repeater {
model: myModel
Label {
text: modelData.title
}
TextArea {
text: modelData.value
}
}
}
But QML Repeater
allows only one element. Any ideas how I could get the layout I want?
+------------+---------------------------------------+
| | |
| title0 | value0 |
| | |
| | |
+------------+---------------------------------------+
| | |
| | |
| title1 | value1 |
| | |
| | |
+------------+---------------------------------------+
| | |
| title2 | value2 |
| | |
| | |
+------------+---------------------------------------+