[Closed] Is it possible to create a dynamic QML instance of an element and give it an id ?
Hello,
and if so, how ?
;=)
7 replies
http://doc.qt.nokia.com/main-snapshot/qml-component.html#createObject-method
Will this help you?
I used following code in one of my project.
http://kunalmaemo.blogspot.com/2011/04/creating-qml-element-dynamically-on.html
I was wondering the same thing. You can assign your own “id” to the objectName property:
http://doc.qt.nokia.com/4.7-snapshot/qml-qtobject.html#objectName-prop
Then you can write a simple javascript loop if you need to find your object by name, by iterating through its parent’s children.
Yes, but the fact is you have no protections of having two differents objects with the same objectName, which could be troubleSome.
After some work in QML, i find it not that much annoying, since the most important things are done in C++ side, except displaying, oeuf corse.
So….
This is perhaps the time to close this post ;)
You must log in to post a reply. Not a member yet? Register here!




