[Development] Suggested method to distribute QML library

Martin Leutelt martin.leutelt at basyskom.com
Mon Sep 8 09:20:32 CEST 2014


Hi,
take a look at how the qtquickcontrols plugin does it. It bundles the QML components in the plugin. With that approach you could:- provide a prebuilt plugin that users can bundle with their app- allow them to build your plugin library together with their code (and deploy the plugin to the default qml import pathor someplace else which would require adding a custom import path)
That way your library can be imported by using a plugin import statement and QtCreator can resolve the typesby a provided .qmltypes file (when using the first approach) or by setting a QML_IMPORT_PATH in the .pro file of theapplication using your library (when going with the second approach).
RegardsMartin

Ben Lau <xbenlau at gmail.com> , 9/6/2014 9:14 AM:
hi all,
I am developing a library with set of QML components . It will be shared on Github. I would expect people use it via `git submodule` instead of coping those QML files to their source tree and install to QML module path.
As now the default project created by QT Creator uses resource file to manage QML files. I would like to provide a resource file to let user to include and get the library works. That should also simplify the software build and installation process.
However, QT Creator can not recognise the import path with "qrc" schema. The syntax highlighting and auto completion do not work.
For example,
  import "qrc:/mylib"
  MyLibComponent {  }

QT Creator will put a underline in "MyLibComponent" . But it could be compiled and executed. 
Any suggested method to solve this problem /  distribute a QML library , so that user can bundle the library inside their app easily?
Thank for any advise.

 

_______________________________________________ 
Development mailing list 
Development at qt-project.org 
http://lists.qt-project.org/mailman/listinfo/development 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140908/5fe2c6b5/attachment.html>


More information about the Development mailing list