I don't think there is a natural way to do so as QML is supposed to be declarative primarily.
You can, however, achieve the nearly same results by putting your factory functions to JavaScript of either a parent QML object or JavaScript library.
Cheers,
Artem.
> _______________________________________________
> Qt-qml mailing list
> Qt-...@qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-qml
_______________________________________________
Qt-qml mailing list
Qt-...@qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-qml
If you don't want a custom QML type to be instantiable, you can register it using the overloaded version of qmlRegisterType() that doesn't take any arguments
See the discussion at http://lists.qt.nokia.com/pipermail/qt-qml/2010-October/001470.html
cheers,
Bea
You should take a look at the Loader element.
http://doc.qt.nokia.com/latest/qml-loader.html
You can also do this with a javascript function that uses Component.
> If you don't want a custom QML type to be instantiable, you can register it using the overloaded version of qmlRegisterType() that doesn't take any arguments
>
> See the discussion at http://lists.qt.nokia.com/pipermail/qt-qml/2010-October/001470.html
If this is what he wants, I'd go with registering a global object on the
context instead of this weird hack.
Bo Thorsen,
Fionia Software.
--
Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk