I am looking for a way to access the number of elements that are to be found in a model in QML.
For example:
Item {
id: root
Row {
id: row
height: root.height
width: root.width
spacing: 5
Repeater {
id: rep
width: root.width
height: root.height
model: [5, 3, 3, 1, 12]
delegate: myDelegate
Text {
id: myDelegate
text: "Element " + index + " of " size + ":" + modelData
}
}
}
But I can't figure out how to retrieve the size of the model.
In the documentation I can find a property called count
, but no hint how to access it.