Calling functions with typedef arguments in qml
QML and Qt Quick
4
Posts
2
Posters
1.3k
Views
1
Watching
-
wrote on 1 Mar 2014, 07:14 last edited by
what is the difference between this two functions when calling from qml:
typedef QVariantMap NewType;
Q_INVOKABLE QVariantMap testFunc();
Q_INVOKABLE NewType testFunc();calling first function works but calling second function gives error.
how can i tell to qml engine that NewType is same as QVariantMap? -
Hi and welcome to devnet,
You need to register your new types to make them known to Qt and QML
-
wrote on 2 Mar 2014, 04:41 last edited by
thanks SGaist,
we can only register QObject derived types.
this type is QVariantMap. -
Indeed, sorry I didn't state it explicitly, you have more information about the procedure "here":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-definetypes.html
1/4