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

[Quick Compiler] can not be used in the shared library

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.4.0
    • 5.3.1
    • Build tools: Other
    • None
    • Ubuntu14.04LTS64 + Qt5.3.1

    Description

      At first, maybe this is not a bug.
      I want to show the qml which are contained in a shared library that compiled by Qt Quick Compiler.
      I do my best, but can not succeed.

      A project:
      It is a shared library that compiled by qtquickcompiler.
      [.pro]
      QT += qml quick
      TEMPLATE = lib
      CONFIG+=qtquickcompiler
      TARGETPATH=...
      [.qrc]
      main.qml

      B project:
      It is a application which loads the .so file that made by A project.
      [.pro]
      TEMPLATE = app
      [main.cpp]
      Load the .so file by the function(QLibrary.load).

      Result:
      [
      QQmlApplicationEngine failed to load component
      qrc:///main.qml:-1 File not found
      ] is output. And GUI is not be shown.

      I saw Issues http://doc.qt.digia.com/QtQuickCompiler/qquickcompiler-known-issues.html,and used Q_INIT_RESOURCE, but also failed.
      (There are not binary data about qml file in the .qrc file which is made by qtquickcompiler.)

      I analyzed Qt source of 5.3.1, I find the difference.
      Function registerQmlUnitCacheHook()[in qqmlmetatype.cpp] is not called.
      (The sourcecode [Q_CONSTRUCTOR_FUNCTION(_registerQmlCache);] in qtquickcompiler_loader.cpp is not executed?)

      Any solution? Thank you!

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            dss0204 ding shusheng
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes