Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-35754

QtQuick and QtQuick.Controls modules are not available at runtime static

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.7.0 Beta
    • 5.2.0
    • Quick: Controls 1
    • Linux pc 3.11.0-12-generic #19-Ubuntu SMP Wed Oct 9 16:20:46 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
    • 00648503bb5fb6e29273ac14c478563ea6ebd17e (qtbase) ec5a886d4b92a18669d5bbd01b43a57f7d81b856 (qtdeclarative) b4c13916ec0fd7796acdf0ec5a1db0134479b3f2 (qtquickcontrols)

    Description

      Built qt5.2.0 with:
      ./configure -static -release -nomake examples -nomake tests -confirm-license

      After building, my application show the following lines in console:
      qrc:/MyFile.qml:1 module "QtQuick" is not installed
      qrc:/MyFile.qml:2 module "QtQuick.Controls" is not installed
      qrc:/MyFile.qml:1 module "QtQuick" is not installed
      qrc:/MyFile.qml:2 module "QtQuick.Controls" is not installed

      edit
      I can provide some info here, as this is a VERY CRITICAL issue for our company, and is a complete blocker from allowing us to deploy our software standalone.

      The QML file should have the following items:

      import QtQuick 2.4
      import QtQuick.Controls 1.3
      import QtQuick.Window 2.2
      import QtQuick.Dialogs 1.2
      

      Qt itself should be configured the same way already mentioned, then installed to a location where our application can compile against it. After compiling, MOVE/REMOVE WHERE QT WAS INSTALLED before running the compiled and installed application! This is to prove that the application got compiled as a stand-alone, static application. Instead, we get the errors mentioned above of QtQuick items not installed.

      What I've seen many other people attempt to do is put in code similar to this:

      Q_IMPORT_PLUGIN(QtQuick2Plugin)
      Q_IMPORT_PLUGIN(QtQuickControlsPlugin)
      Q_IMPORT_PLUGIN(QtQuickLayoutsPlugin)
      
      int main(int argc, char *argv[]) {
        qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuick2Plugin().instance())->registerTypes("QtQuick");
        qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickControlsPlugin().instance())->registerTypes("QtQuick.Controls");
        qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickControlsPlugin().instance())->registerTypes("QtQuick.Controls.Private");
        qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickControlsPlugin().instance())->registerTypes("QtQuick.Controls.Styles");
        qobject_cast<QQmlExtensionPlugin*>(qt_static_plugin_QtQuickLayoutsPlugin().instance()) ->registerTypes("QtQuick.Layouts");
      }
      

      But this is ALSO buggy for the following reasons:
      1. You'd need to add some STATIC compile flag to wrap around it. Not difficult, but still annoying.
      2. You HAVE to move/remove/uninstall where Qt was installed before running the application, or else you get errors of the QtQuick modules already being imported or used.
      3. The application will STILL fail. The common error see a lot of people have is ApplicationWindow ContentItem missing, or something to that extent...

      Either way, there desperately needs to be some support for deploying statically built QML applications! I've found 0 documentation on what these QML plugins are and their names, and this is a MASSIVE blocker for our company, to where we are now forced to have to deliver our software with Qt shared libraries...

      Another related ticket is QTBUG-39462.

      Attachments

        Issue Links

          Activity

            People

              andysh Andy Shaw
              sgrebenkin Sergey Grebenkin
              Votes:
              5 Vote for this issue
              Watchers:
              19 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: