Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Deploying QML Dependencies

Deploying QML Dependencies

Scheduled Pinned Locked Moved Solved Installation and Deployment
qmlembeddedlinux
7 Posts 2 Posters 2.1k 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.
  • H Offline
    H Offline
    h4xx
    wrote on 28 Feb 2020, 03:36 last edited by
    #1

    Hi there!
    I've been working on a Qt application for embedded Linux, and would like to deploy it.
    For such, I've successfully used rcc to generate bundles containing several sets of files.

    I'd like to know whether I can use such tool to bundle all QtQuick.2, QtQml, and QtQuick files the runtime depends upon into a single rcc file. Searching the forum, I learned about windeployqt and wonder whether there's a tool like that for Linux. I have also searched the docs, but to no avail.

    Could someone kindly point an article or help topic with further information about those deployment steps? Or knows whether it is possible to create such bundle instead of copying all qml folder structure into the deployment target?

    Cheers,
    Henderson

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sierdzio
      Moderators
      wrote on 28 Feb 2020, 06:42 last edited by
      #2

      I'd like to know whether I can use such tool to bundle all QtQuick.2, QtQml, and QtQuick files the runtime depends upon into a single rcc file

      Not sure, but it might work if you load your main QML file from resources as well.

      a tool like that for Linux

      There is an unofficial (but very good!) deployment tool: https://github.com/probonopd/linuxdeployqt.

      Could someone kindly point an article or help topic with further information about those deployment steps? Or knows whether it is possible to create such bundle instead of copying all qml folder structure into the deployment target?

      Guide to deployment is here https://doc.qt.io/qt-5/linux-deployment.html but it won't help much in your case.

      Bundles - you can create .deb, .rpm packages, or go with Flatpak - but none of these are built into Qt. You need to write your own script or deployment code in qmake.

      (Z(:^

      1 Reply Last reply
      1
      • H Offline
        H Offline
        h4xx
        wrote on 28 Feb 2020, 21:35 last edited by
        #3

        Hi @sierdzio! Thank you so much for replying!

        Not sure, but it might work if you load your main QML file from resources as well.

        I do! All files are contained in rcc files. Do you know whether I can run something like rcc /my/qt/installation/qml -o quick.rcc and load it dynamically? I'm pretty worried about .so files living in /my/qt/installation/qml. My main goal is to provide a single file containing all deps Qt needs for QML handling instead of a huge tree.

        There is an unofficial (but very good!) deployment tool

        Thanks! I reviewed that tool, but it does not do what I expected...
        Can qmlimportscanner help somehow? I'm completely lost amidst those tools.

        S 1 Reply Last reply 1 Mar 2020, 06:33
        0
        • H h4xx
          28 Feb 2020, 21:35

          Hi @sierdzio! Thank you so much for replying!

          Not sure, but it might work if you load your main QML file from resources as well.

          I do! All files are contained in rcc files. Do you know whether I can run something like rcc /my/qt/installation/qml -o quick.rcc and load it dynamically? I'm pretty worried about .so files living in /my/qt/installation/qml. My main goal is to provide a single file containing all deps Qt needs for QML handling instead of a huge tree.

          There is an unofficial (but very good!) deployment tool

          Thanks! I reviewed that tool, but it does not do what I expected...
          Can qmlimportscanner help somehow? I'm completely lost amidst those tools.

          S Offline
          S Offline
          sierdzio
          Moderators
          wrote on 1 Mar 2020, 06:33 last edited by
          #4

          @h4xx said in Deploying QML Dependencies:

          Hi @sierdzio! Thank you so much for replying!

          Not sure, but it might work if you load your main QML file from resources as well.

          I do! All files are contained in rcc files. Do you know whether I can run something like rcc /my/qt/installation/qml -o quick.rcc and load it dynamically? I'm pretty worried about .so files living in /my/qt/installation/qml. My main goal is to provide a single file containing all deps Qt needs for QML handling instead of a huge tree.

          Yes resources can be loaded dynamically, see the documentation. https://doc.qt.io/qt-5/resources.html

          If you want a single, hassle-free package, use linuxdeployqt with -appimage flag.

          There is an unofficial (but very good!) deployment tool

          Thanks! I reviewed that tool, but it does not do what I expected...
          Can qmlimportscanner help somehow? I'm completely lost amidst those tools.

          (Z(:^

          1 Reply Last reply
          2
          • H Offline
            H Offline
            h4xx
            wrote on 5 Mar 2020, 05:19 last edited by
            #5

            Hey @sierdzio! Thanks for your input!
            I was successfully able to bundle all Qt QML files into a single rcc file, and the application was able to find them!
            One last issue I have is to make Qt find .so files (such as libqtquickcontrols2plugin.so) inside that said RCC file.

            Enabling tracing shows that it attempts to load it from :/qml/QtQuick/Controls.2 as expected, but it fails:

            ...
            QQmlImportDatabase::addImportPath: ":/qml"
            QQmlImports(qrc:/qml/main.qml)::addLibraryImport: "QtQuick" 2.12 as ""
            QQmlImports(qrc:/qml/main.qml)::addLibraryImport: "QtQuick.Controls" 2.12 as ""
            QQmlImports(qrc:/qml/main.qml)::importExtension: loaded ":/qml/QtQuick/Controls.2/qmldir"
            QQmlImportDatabase::resolvePlugin: Could not resolve plugin "qtquickcontrols2plugin" in ":/qml/QtQuick/Controls.2"
            QQmlApplicationEngine failed to load component
            qrc:/qml/main.qml:2 module "QtQuick.Controls" plugin "qtquickcontrols2plugin" not found
            ...
            

            I made several attempts to change the filename to qtquickcontrols2plugin, libqtquickcontrols2plugin.so, libqtquickcontrols2plugin, and qtquickcontrols2plugin, with no luck. Examining the source of QQmlImportDatabase::resolvePlugin did not help either.

            Do you know wheter this is supported?

            Again, thank you for your help.

            Best wishes,
            Henderson

            1 Reply Last reply
            0
            • S Offline
              S Offline
              sierdzio
              Moderators
              wrote on 5 Mar 2020, 05:36 last edited by
              #6

              I don't know if it is supported.

              (Z(:^

              H 1 Reply Last reply 5 Mar 2020, 05:38
              0
              • S sierdzio
                5 Mar 2020, 05:36

                I don't know if it is supported.

                H Offline
                H Offline
                h4xx
                wrote on 5 Mar 2020, 05:38 last edited by
                #7

                @sierdzio No problem! Will keep on searching. Once again, thanks for your help!

                Best wishes,
                Henderson

                1 Reply Last reply
                0

                6/7

                5 Mar 2020, 05:36

                • Login

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