Create a new QObject from QML scripts
Greetings,
I would like to do something like this from my QML script:
- onPressed: {
- var item = new myQObject;
- }
I did the following in C++:
- qmlRegisterType<MyQObject>("Module", 1,0, "myQObject");
Have I missed something ?
4 replies
I suggest you also to read this useful doc [developer.qt.nokia.com], it has been useful for me :)
Hi,
The syntax you’ve shown isn’t currently supported, but there are a few different ways to deal with dynamic objects in QML — http://doc.qt.nokia.com/4.7-snapshot/qdeclarativedynamicobjects.html provides an overview.
Regards,
Michael
You must log in to post a reply. Not a member yet? Register here!



