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>
This commit is contained in:
parent
86e34dfcdd
commit
be2c03064c
@ -300,13 +300,13 @@ function(qt6_android_generate_deployment_settings target)
|
|||||||
string(APPEND file_contents
|
string(APPEND file_contents
|
||||||
" \"zstdCompression\": ${is_zstd_enabled},\n")
|
" \"zstdCompression\": ${is_zstd_enabled},\n")
|
||||||
|
|
||||||
if(QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS)
|
if(QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS)
|
||||||
set(is_generate_java_qml_components "true")
|
set(is_generate_java_qtquickview_contents "true")
|
||||||
else()
|
else()
|
||||||
set(is_generate_java_qml_components "false")
|
set(is_generate_java_qtquickview_contents "false")
|
||||||
endif()
|
endif()
|
||||||
string(APPEND file_contents
|
string(APPEND file_contents
|
||||||
" \"generate-java-qml-components\": ${is_generate_java_qml_components},\n")
|
" \"generate-java-qtquickview-contents\": ${is_generate_java_qtquickview_contents},\n")
|
||||||
# Last item in json file
|
# Last item in json file
|
||||||
|
|
||||||
# base location of stdlibc++, will be suffixed by androiddeploy qt
|
# base location of stdlibc++, will be suffixed by androiddeploy qt
|
||||||
|
@ -322,10 +322,10 @@ The mentioned variables are used internally by \l{androiddeployqt}.
|
|||||||
\ingroup cmake-variables-qtcore
|
\ingroup cmake-variables-qtcore
|
||||||
\ingroup cmake-android-build-properties
|
\ingroup cmake-android-build-properties
|
||||||
|
|
||||||
\title QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
|
\title QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
|
||||||
\target cmake-variable-QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS
|
\target cmake-variable-QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
|
||||||
|
|
||||||
\summary {Enables the generation of QtQmlComponent-based classes.}
|
\summary {Enables the generation of QtQuickViewContent-based classes.}
|
||||||
\cmakevariablesince 6.8
|
\cmakevariablesince 6.8
|
||||||
\preliminarycmakevariable
|
\preliminarycmakevariable
|
||||||
\cmakevariableandroidonly
|
\cmakevariableandroidonly
|
||||||
@ -335,8 +335,8 @@ generated code will be included in the resulting package. The Java package name
|
|||||||
classes will be the same as the Android app package. If the leaf part of the package name is
|
classes will be the same as the Android app package. If the leaf part of the package name is
|
||||||
not the same as the target executable, an extra static class with the same name as the
|
not the same as the target executable, an extra static class with the same name as the
|
||||||
capitalized target executable will surround all QML modules enclosing Java classes. Each QML
|
capitalized target executable will surround all QML modules enclosing Java classes. Each QML
|
||||||
module class, again in a capitalized form, will contain QtQmlComponent extension classes that
|
module class, again in a capitalized form, will contain QtQuickViewContent extension classes
|
||||||
represent QML components of that module.
|
that represent QML components of that module.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
\sa{androiddeployqt}
|
\sa{androiddeployqt}
|
||||||
|
@ -1302,13 +1302,13 @@ bool readInputFile(Options *options)
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
const QJsonValue genJavaQmlComponents = jsonObject.value("generate-java-qml-components"_L1);
|
const QJsonValue genJavaQmlComponents = jsonObject.value("generate-java-qtquickview-contents"_L1);
|
||||||
if (!genJavaQmlComponents.isUndefined() && genJavaQmlComponents.isBool()) {
|
if (!genJavaQmlComponents.isUndefined() && genJavaQmlComponents.isBool()) {
|
||||||
options->generateJavaQmlComponents = genJavaQmlComponents.toBool(false);
|
options->generateJavaQmlComponents = genJavaQmlComponents.toBool(false);
|
||||||
if (options->generateJavaQmlComponents && !options->buildAar) {
|
if (options->generateJavaQmlComponents && !options->buildAar) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"Warning: Skipping the generation of Java components from QML as it can be "
|
"Warning: Skipping the generation of Java QtQuickView contents from QML "
|
||||||
"enabled only for an AAR target.\n");
|
"as it can be enabled only for an AAR target.\n");
|
||||||
options->generateJavaQmlComponents = false;
|
options->generateJavaQmlComponents = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1321,7 +1321,7 @@ bool readInputFile(Options *options)
|
|||||||
} else if (options->generateJavaQmlComponents) {
|
} else if (options->generateJavaQmlComponents) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"No qmldom binary defined in json file which is required when "
|
"No qmldom binary defined in json file which is required when "
|
||||||
"building with QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag.\n");
|
"building with QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS flag.\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3708,7 +3708,7 @@ int generateJavaQmlComponents(const Options &options)
|
|||||||
if (moduleInfo.moduleName == libName) {
|
if (moduleInfo.moduleName == libName) {
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"A QML module name (%s) cannot be the same as the target name when building "
|
"A QML module name (%s) cannot be the same as the target name when building "
|
||||||
"with QT_ANDROID_GENERATE_JAVA_QML_COMPONENTS flag.\n",
|
"with QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS flag.\n",
|
||||||
qPrintable(moduleInfo.moduleName));
|
qPrintable(moduleInfo.moduleName));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user