- Qt 6.11
- Qt Core
- CMake Variables in Qt6 Core
- QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS
- Qt 6.11.1 Reference Documentation

# QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS

Enables the generation of QtQuickViewContent-based classes.

This variable was introduced in Qt 6.8.

Note: This variable is in technology preview and may change in future releases.

Note: This variable is used only if targeting the Android platform.

Set to `TRUE` to enable Java code generation for QML components of the target application. The generated code will be included in the resulting package. The Java package name of generated 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 capitalized target executable will surround all QML modules enclosing Java classes. Each QML module class, again in a capitalized form, will contain QtQuickViewContent extension classes that represent QML components of that module.

     set(QT_ANDROID_GENERATE_JAVA_QTQUICKVIEW_CONTENTS TRUE)
     set_source_files_properties(MyView.qml PROPERTIES QT_QML_GENERATE_ANDROID_JAVA_CLASS TRUE)
     qt_add_qml_module(myapp URI MyModule QML_FILES MyView.qml)

See also QT_QML_GENERATE_ANDROID_JAVA_CLASS and androiddeployqt.