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

QML apps based on QQuickViewer are not runnable using static build of Qt 5 due to "qtquick2plugin" issue

    XMLWordPrintable

Details

    Description

      I have built Qt 5.0 RC statically and added it to building "Kit" in QtCreator 2.6 (Qt5 sources were taken from git yesterday, configured with "-debug-and-release -static -opensource -confirm-license -nomake examples -nomake tests -no-icu -opengl desktop -platform win32-msvc2010" and built fully successfull without any errors).

      Then i tried to build simple QtQuick 2 "Hello world" project created by QtCreator's wizard and based on QQuickView descendant. Build was successfull (both debug and release).

      Running executable shows only narrow horizontal windows header of the application and is not useable. In debug mode i see following in the pane:

      module "QtQuick" plugin "qtquick2plugin" not found
      import QtQuick 2.0
      ^
      Remove me: fixing toplevel window flags
      Unable to find a renderable master window QtQuick2ApplicationViewer(0x1bfd74) when trying to render QtQuick2ApplicationViewer(0x1bfd74) ( QRect(4,26 116x0) )

      So i tried to add some workaround for QtQuick2 plugin same as for "windows" platform plugin linked statically:
      .pro file :

      contains(QT_CONFIG, static) {
        QTPLUGIN += windows \
                    qtquick2plugin
        DEFINES += STATIC_BUILD
        LIBS += -L"d:\SDK\Qt5.0\qtbase\qml\QtQuick.2"  
      }

      main.cpp :

      ...
      #include <QtPlugin>
      #ifdef STATIC_BUILD
      Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
      Q_IMPORT_PLUGIN(QtQuick2Plugin)
      #endif
      ...

      Application builds successfully but after running app the same problem is stayed...

      Then i tried to put manually "d:\SDK\Qt5.0\qtbase\qml\QtQuick.2" folder from that static Qt 5.0 build to folder of executable, according to docs. Result is the same. The reason may be that there are not any plugin *.dlls (qtquick2plugin.dll), only qtquick2plugin.lib and qtquick2plugind.lib. The "qmldir" also present.

      Then i tried to take same "QtQuick.2" plugin folder from my previous dynamically built Qt 5.0 beta 2 and put it near executable. It contains expected "qtquick2plugin.dll" file. Application was not runnable yet but situation has changed after this action. I saw different debug message in the pane:

      plugin cannot be loaded for module "QtQuick": Unknown error
      import QtQuick 2.0
      ^
      Remove me: fixing toplevel window flags
      Unable to find a renderable master window QtQuick2ApplicationViewer(0x1bfa90) when trying to render QtQuick2ApplicationViewer(0x1bfa90) ( QRect(4,26 116x0) )

      So in result QML aplications are not useable with Qt5.0 static build now. What can i do to workaround it? Help please..

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sorvig Morten Sørvig
              avassen Vasily Shchukin
              Votes:
              25 Vote for this issue
              Watchers:
              42 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes