Calling functions with typedef arguments in qml
-
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
-
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