[Qt-qml] How to add/remove/count items in a list<Item> property from within javascript?
Bart Kelsey
elbarto at gmail.com
Mon Oct 25 22:04:33 CEST 2010
Greets!
I'm trying to create a list of Items, and it's not clear to me, from within
JavaScript, how to add, remove, and count those items. The function below
doesn't seem to work (textArray is declared as "property list<Item>
textArray"). Note that my startUp function is being correctly called, and I
can verify that the TalkBoxTextComponent.createObject method is working.
I've tried using .push(), .append(), length, etc, and I'm having no luck so
far.
******
var TalkBoxTextComponent;
function startUp() {
TalkBoxTextComponent = Qt.createComponent("TalkBoxText.qml");
}
function appendText(string) {
var object = TalkBoxTextComponent.createObject(talkbox);
object.text = string;
talkbox.textArray[0] = object;
talkbox.textArray[1] = object;
}
******
Thanks,
Bart
--
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt.nokia.com/pipermail/qt-qml/attachments/20101025/58769d7b/attachment.html
More information about the Qt-qml
mailing list