Create a new QObject from QML scripts
I would like to do something like this from my QML script:
var item = new myQObject;
I did the following in C++:
@qmlRegisterType<MyQObject>("Module", 1,0, "myQObject");@
Have I missed something ?
I think you should use something like:
but of course use a capital letter for MyObject
I suggest you also to read this useful "doc":http://developer.qt.nokia.com/doc/qt-4.7/qtbinding.html, it has been useful for me :)
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.