From 5deb4e7d254cc4d460c7ccacfeaafb79c3efc30f Mon Sep 17 00:00:00 2001 From: Assam Boudjelthia Date: Mon, 7 Feb 2022 13:23:43 +0200 Subject: [PATCH] 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 Reviewed-by: Mitch Curtis --- src/tools/androiddeployqt/doc/src/androiddeployqt.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/tools/androiddeployqt/doc/src/androiddeployqt.qdoc b/src/tools/androiddeployqt/doc/src/androiddeployqt.qdoc index b77d3182c51..2e2167f8d05 100644 --- a/src/tools/androiddeployqt/doc/src/androiddeployqt.qdoc +++ b/src/tools/androiddeployqt/doc/src/androiddeployqt.qdoc @@ -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,