Android: document how to handle code that loads QML from strings

If an app is loading QML from a string at runtime from C++, the
dependencies/imports might not be bundled into the app package,
and then the app might fail at runtime. A fix is to have a QML
file with needed imports to properly deploy those impots' libs.

Fixes: QTBUG-100394
Pick-to: 6.2 6.3
Change-Id: I10136dc2dd1ac1f4ffe00bcf2cfd6c98e050ef28
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
This commit is contained in:
Assam Boudjelthia 2022-02-07 13:23:43 +02:00
parent d60af047fe
commit 5deb4e7d25

View File

@ -185,6 +185,12 @@
It's also possible to manually specify the dependencies of your application.
For more information, see \l{ANDROID_DEPLOYMENT_DEPENDENCIES} qmake variable.
\note androiddeployqt scans the QML files of the project to collect the QML imports.
However, if you are loading QML code as a QString from C++ at runtime, that might
not work properly because androiddeployqt won't be aware of it at deploy time.
To remedy that, you can add a dummy QML file that imports such QML modules that
are referenced at runtime.
\section1 Android-specific qmake Variables
Unless the project has special requirements such as third party libraries,