Best way to use custom QML-Plugins in applications?
-
wrote on 24 Mar 2015, 08:51 last edited by
Hey guys,
I have to write several qml-Plugins which I will use from different applications.
I already saw the QQmlExtensionPlugin Class (QQmlExtensionPlugin Class) but I would prefer a static way.Of course I can just import my source files and call all the qmlRegisterType functions manually but maybe there is a recommended way?
CU
mts -
Hey guys,
I have to write several qml-Plugins which I will use from different applications.
I already saw the QQmlExtensionPlugin Class (QQmlExtensionPlugin Class) but I would prefer a static way.Of course I can just import my source files and call all the qmlRegisterType functions manually but maybe there is a recommended way?
CU
mts@themts What do you mean by static way ? AFAIK
QQmlExtensionPlugin
is the recommended way. -
wrote on 25 Mar 2015, 07:33 last edited by
If I understand QQmlExtensionPlugin correctly, it is a plugin interface class to load qml extensions which are already compiled. So I would create a plugin project, compile it and load it dynamically by me application.
I don't want to compile it to a binary, I want to compile it with my application.
Would I use the QQmlExtensionPlugin class anyway and call registerTypes myself? -
wrote on 25 Mar 2015, 13:44 last edited by
Ok, I found something in the docs:
http://doc.qt.io/qt-5/plugins-howto.html#static-plugins -
Ok, I found something in the docs:
http://doc.qt.io/qt-5/plugins-howto.html#static-plugins@themts Good find. Seems suitable for your requirement.
5/5