QT_HARMONYOS_ABILITY_ORIENTATION

The screen-orientation policy of the HarmonyOS ability.

This property was introduced in Qt 6.12.

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

Note: This property is used only if targeting the HarmonyOS platform.

Specifies the screen-orientation policy of the application's ability. The value is written to entry/src/main/module.json5 when the HAP package is built. 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.

If this property is not set, the field is omitted from the manifest and the system default applies.

 set_target_properties(myapp PROPERTIES
     QT_HARMONYOS_ABILITY_ORIENTATION "landscape"
 )