Use the setProperty http://doc.qt.nokia.com/4.7-snapshot/qml-listmodel.html#setProperty-method It's not an ordinary JavaScript object.
I.e. Instead of "tagColumnModel.get( pos ).tagState = "newState"; " Do "tagColumnModel.setProperty(pos, "tagState", "newState"); " From: ext Francesco Nwokeka <[email protected]<mailto:[email protected]>> Date: Sun, 30 Jan 2011 13:59:57 +0100 To: <[email protected]<mailto:[email protected]>> Subject: [Qt-qml] PROBLEM : "state" of object inside ListView does not update correctly Hi guys, I have a little problem. I can't seem to update the state of my custom button that is inside my delegate. Here is the structure: // TagColumn ListView{ ListModel{ id: tagColumnModel } model: tagColumnModel delegate: TagColumnDelegate{} ... ... } // TagColumnDelegate Component { TagButton{ text: tagName state: tagState ... ... } } when I need to add a tag, I do it with a function that does: "tagColumnModel.append( { "tagName": newTag, "tagState": "newState" } ); and when i want to modify the state of an object inside my ListModel, i do: "tagColumnModel.get( pos ).tagState = "newState"; " but QML doesn't update the button's state with the new one given. Even though when i go read the new state from the model everything is updated. Do you have any hints on how to do this? Thanks for your time, Francesco _______________________________________________ Qt-qml mailing list [email protected]<mailto:[email protected]> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
_______________________________________________ Qt-qml mailing list [email protected] http://lists.qt.nokia.com/mailman/listinfo/qt-qml
