[Solved] Deploying QML library/imports

  • I have now managed to create a QML plugin and some imports. My imports folder structure looks like this:
    @imports/Bla/<some qml files>
    imports/Blu/<qml lib>
    imports/Blu/Foo/<some qml files>@

    How can use this lib and imports to deploy it with my application? I know there is the QML_IMPORT_PATH variable, however, it is only for Qt Creator to find the files. How can I tell qmake to bundle the libraries with the binary (or to but it in the same output folder)?


  • So it worked out like this:

    I created a subdir project with library and application.
    To the library I added this:
    @folder_01.source = imports
    folder_01.target =
    DEPLOYMENTFOLDERS += folder_01


    Where deployment.pri is the file that came (It does not come with Qt Creator 3.1 anymore) when creating a new QtQuick project.

    To the applications I added this:
    @# Additional import path used to resolve QML modules in Qt Creator's code model
    QML_IMPORT_PATH = $$relative_path($$OUT_PWD/../qmlhalplugin/imports, $$PWD)

    Add more folders to ship with the application, here

    folder_01.source = $$QML_IMPORT_PATH
    folder_01.target =
    folder_02.source = qml
    folder_02.target =
    DEPLOYMENTFOLDERS += folder_01
    Now I can compile the whole subdir project.

Log in to reply