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"
}
......
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"
}
......