Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.3.1
-
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!