how to make QML shared Libraries and use it
-
I have some custom made QML controls which contains only .qml files no .CPP.
I need to share/use it on other projects such that my qml files and its contents will not be visible to third parties.How about creating a shared library .dll or .so files of QML files which can be linked during compile time
OR
How about creating a plugin library file which can be used during runtime.suggestions and helps please.
Thanks in advance. -
Hi, what you want is called a module in QML.
See http://doc.qt.io/qt-5/qtqml-modules-topic.html
and http://doc.qt.io/qt-5/qtqml-modules-qmldir.html -
Hi,
From the documentation i am able to understand that, I have to use qml files as such and provide the entries in qmldir file for each file.
In this case the QML files are exposed. !!Is there is any way QML files can be included in a DLL and use it on another project ?
If i am misunderstood please the doc please let me know.
Thank you. -
@Navaneeth maybe this can help you http://doc.qt.io/QtQuickCompiler/
-
@greenhouse , Thank you for your post, it was informative. I have made a lib using the following .pro file.
TEMPLATE = lib TARGET = QMLLibrary # Input RESOURCES += qml.qrc CONFIG += qtquickcompiler #CONFIG += lib
there are two QML files in qrc file.
ClickButton.qml CustomButton.qml
And i have .dll fileQMLLibrary.dll
in my release folder.
Now how can i use the those qml components using the lib i generated. ?