Skip to content

Commit be2c030

Browse files
committed
Android: Rename opt-in CMake flag that generates QML to Java code
The Java QtQmlComponent has been renamed to QtQuickViewContent as a part of API reviews. As a result, we also change the opt-in flag From QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS To QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS that adds an entry to the android-deployment-settings.json. The flags later will be used by androiddeployqt to enable the generation of QtQuickViewContent extensions. Pick-to: 6.8 Task-number: QTBUG-126976 Task-number: QTBUG-127091 Change-Id: Ie08a9430a5e5a16809f78389144a4a6dfd87ce18 Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io> Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
1 parent 86e34df commit be2c030

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/corelib/Qt6AndroidMacros.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,13 +300,13 @@ function(qt6_android_generate_deployment_settings target)
300300
string(APPEND file_contents
301301
" \"zstdCompression\": ${is_zstd_enabled},\n")
302302

303-
if(QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS)
304-
set(is_generate_java_qml_components "true")
303+
if(QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS)
304+
set(is_generate_java_qtquickview_contents "true")
305305
else()
306-
set(is_generate_java_qml_components "false")
306+
set(is_generate_java_qtquickview_contents "false")
307307
endif()
308308
string(APPEND file_contents
309-
" \"generate-java-qml-components\": ${is_generate_java_qml_components},\n")
309+
" \"generate-java-qtquickview-contents\": ${is_generate_java_qtquickview_contents},\n")
310310
# Last item in json file
311311

312312
# base location of stdlibc++, will be suffixed by androiddeploy qt

src/corelib/doc/src/cmake/cmake-configure-variables.qdoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,10 +322,10 @@ The mentioned variables are used internally by \l{androiddeployqt}.
322322
\ingroup cmake-variables-qtcore
323323
\ingroup cmake-android-build-properties
324324

325-
\title QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
326-
\target cmake-variable-QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
325+
\title QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
326+
\target cmake-variable-QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
327327

328-
\summary {Enables the generation of QtQmlComponent-based classes.}
328+
\summary {Enables the generation of QtQuickViewContent-based classes.}
329329
\cmakevariablesince 6.8
330330
\preliminarycmakevariable
331331
\cmakevariableandroidonly
@@ -335,8 +335,8 @@ generated code will be included in the resulting package. The Java package name
335335
classes will be the same as the Android app package. If the leaf part of the package name is
336336
not the same as the target executable, an extra static class with the same name as the
337337
capitalized target executable will surround all QML modules enclosing Java classes. Each QML
338-
module class, again in a capitalized form, will contain QtQmlComponent extension classes that
339-
represent QML components of that module.
338+
module class, again in a capitalized form, will contain QtQuickViewContent extension classes
339+
that represent QML components of that module.
340340
*/
341341

342342
\sa{androiddeployqt}

src/tools/androiddeployqt/main.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1302,13 +1302,13 @@ bool readInputFile(Options *options)
13021302
}
13031303

13041304
{
1305-
const QJsonValue genJavaQmlComponents = jsonObject.value("generate-java-qml-components"_L1);
1305+
const QJsonValue genJavaQmlComponents = jsonObject.value("generate-java-qtquickview-contents"_L1);
13061306
if (!genJavaQmlComponents.isUndefined() && genJavaQmlComponents.isBool()) {
13071307
options->generateJavaQmlComponents = genJavaQmlComponents.toBool(false);
13081308
if (options->generateJavaQmlComponents && !options->buildAar) {
13091309
fprintf(stderr,
1310-
"Warning: Skipping the generation of Java components from QML as it can be "
1311-
"enabled only for an AAR target.\n");
1310+
"Warning: Skipping the generation of Java QtQuickView contents from QML "
1311+
"as it can be enabled only for an AAR target.\n");
13121312
options->generateJavaQmlComponents = false;
13131313
}
13141314
}
@@ -1321,7 +1321,7 @@ bool readInputFile(Options *options)
13211321
} else if (options->generateJavaQmlComponents) {
13221322
fprintf(stderr,
13231323
"No qmldom binary defined in json file which is required when "
1324-
"building with QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag.\n");
1324+
"building with QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS flag.\n");
13251325
return false;
13261326
}
13271327
}
@@ -3708,7 +3708,7 @@ int generateJavaQmlComponents(const Options &options)
37083708
if (moduleInfo.moduleName == libName) {
37093709
fprintf(stderr,
37103710
"A QML module name (%s) cannot be the same as the target name when building "
3711-
"with QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag.\n",
3711+
"with QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS flag.\n",
37123712
qPrintable(moduleInfo.moduleName));
37133713
return false;
37143714
}

0 commit comments

Comments
 (0)