Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    [Solved] Deploying QML library/imports

    QML and Qt Quick
    1
    2
    1570
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • strahlex
      strahlex last edited by

      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)?

      Regards
      Alexander

      Feel free to check out my website machinekoder.com
      and my pet projects Intellicute and QtQuickVcp

      1 Reply Last reply Reply Quote 0
      • strahlex
        strahlex last edited by

        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

        include(deployment.pri)
        qtcAddDeployment()
        @

        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
        folder_02@
        Now I can compile the whole subdir project.

        Feel free to check out my website machinekoder.com
        and my pet projects Intellicute and QtQuickVcp

        1 Reply Last reply Reply Quote 0
        • First post
          Last post