I have a ListView
ListModel
with 10 ListElements, I want the ListView to display the first ListElement from the model.
Is there a way to limit the number of ListElement
items that are displayed, or select the ListElement
to display from an ID in the data?
Example ListModel:
ListModel { id: homeMenuModelData ListElement { name: "Sam Wise Is A Very Wise Man" number: "555 0473" } ListElement { name: "Bill Smith" number: "555 3264" } ListElement { name: "John Brown" number: "555 8426" }}
The ListView:
ListView { anchors.fill: parent interactive: false model: HomeMenuModel delegate: homeMenuDelegate highlight: Rectangle { color: "lightsteelblue"; radius: 5 } focus: true}
I'm thinking something like this would be useful to me:
model.clear();for( var i=0; i < bookList.length ; ++i ) { model.append(bookList[i]);}