qt_set_harmonyos_module_metadata
Sets HarmonyOS module-level metadata on the target.
The command is defined in the Core component of the Qt6 package, which can be loaded like so:
find_package(Qt6 REQUIRED COMPONENTS Core)This command was introduced in Qt 6.12.
Note: This command is in technology preview and may change in future releases.
Note: This command should only be called if targeting the HarmonyOS platform.
Synopsis
qt_set_harmonyos_module_metadata(target
[DESCRIPTION <description>]
[DEVICE_TYPES <type> [<type>...]]
[ORIENTATION <orientation>]
)If versionless commands are disabled, use qt6_set_harmonyos_module_metadata() instead. It supports the same set of arguments as this command.
Description
The command sets module-level metadata for the HarmonyOS target executable. The values are conceptually module-scoped (they describe a single HAP module) and are written into entry/src/main/module.json5 when the HAP package is built. Application-scoped metadata, such as the vendor or version, is set with qt_set_harmonyos_app_metadata() instead. Options that are not specified leave the corresponding manifest field at its default.
Arguments
DESCRIPTION is the module description. It accepts either a literal string (which appears verbatim in the manifest and is not localizable) or a $string:<name> resource reference that resolves to a localized string from the application's resource files.
DEVICE_TYPES is the list of HarmonyOS device-type identifiers that the module supports, for example tablet, 2in1, or phone. When unset, a Qt-provided default is used.
ORIENTATION sets the screen-orientation policy of the application's ability. When unset, the field is omitted from the manifest and the system default applies. The accepted values are the orientation strings defined by the HarmonyOS module.json5 schema, including auto_rotation, auto_rotation_restricted, landscape, portrait, auto_rotation_landscape, auto_rotation_portrait, and locked. An unrecognized value is ignored with a warning at HAP build time.
Example
qt_set_harmonyos_module_metadata(myapp
DESCRIPTION "My Application module"
DEVICE_TYPES tablet 2in1
ORIENTATION landscape
)See also qt_set_harmonyos_app_metadata() and Qt for HarmonyOS CMake API.
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.