Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. [Solved] Deploying QML library/imports

[Solved] Deploying QML library/imports

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 1 Posters 1.7k Views
  • 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.
  • strahlexS Offline
    strahlexS Offline
    strahlex
    wrote on last edited by
    #1

    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
    0
    • strahlexS Offline
      strahlexS Offline
      strahlex
      wrote on last edited by
      #2

      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
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved