PDA

View Full Version : QDeclarativeListProperty add item from qml application



goli
29th June 2011, 16:07
is there any why to add item to QDeclarativeListProperty from qml file at run time?
in a loop, for example.

var i;
for(i = 0 ; i < listOfItems.length ; ++i)
{
listOfItems.append(MyItem {
text:"list"+i
})
}

and listOfItems is the QDeclarativeListProperty list...
i dont want to do it like this:

listOfItems:
[
MyItem
{
text:"list val1"
},
MyItem
{
text:"list val2"
}
......

moldovan_catalin
3rd September 2011, 15:31
Have you by chance found an answer to this? I'm having the same problem and I couldn't find an answer anywhere.
Thanks.