[Solved] Repeater should not display all model-items
-
wrote on 24 Feb 2012, 11:09 last edited by
I have got one model and two repeaters.
I would like to show the first half of the model items in the first repeater and the second half in the second repeater. The visibility of the repeaters can be toggled (if 1 is visible, 2 is invisible and the other way around)Is it somehow possible to split a model in QML so that it can be used in two repeaters?
I was also thinking about creating two models, but I would like to have only one model.
The model is created in C++. -
wrote on 28 Feb 2012, 11:12 last edited by
I have solved my problem.
Instead of a Repeater, I'm using a ListView now which has the width of 5 elements. When I press the button to toggle the visible buttons, I set
@
if(bFirst)
{
listView.positionViewAtIndex(0, ListView.Beginning)
}
else
{
listView.positionViewAtIndex(5, ListView.Beginning)
}
@
Like this I could achieve what I wanted with only one model.
1/2