Qml Library
-
Hi everyone,
I have seen that it is possible to create a library from C++ so it can be used as a plugin in QML.
I was wondering if it was possible to do the same but from QML to QML.
I have some custom objects that i would like to regroup in on library so in future project i only have to do "import MyWidgets" and add this library in the project. Without having to copy every .qml files into the new project as well as pictures.If anyone has an idea on the subject I would really appreciate it ?
Thanks -
Hi,
See http://qt-project.org/doc/qt-5.1/qtqml/qtqml-modules-topic.html for information on creating QML modules (which can be imported by QML applications or other modules).
Cheers,
Chris. -
So I need a little bit of help. I created a specific folder at the root of my project with all my .qml files as well as the qmldir file.
I am now looking on how to import it so I can use import MyModule 1.0 and to be sure that files are embedded with the app.Any idea on how to it ? I have tried with QQmlEngine::addImportPath() with no success, as well as trying to set QML2_IMPORT_PATH.
-
You need to use "Qt resource system":http://doc-snapshot.qt-project.org/qt5-nosubdir/qtquick-deployment.html