Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qt_set_harmonyos_module_metadata.qdoc
Go to the documentation of this file.
1// Copyright (C) 2026 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
3
4/*!
5\page qt-set-harmonyos-module-metadata.html
6\ingroup cmake-commands-qtcore
7
8\title qt_set_harmonyos_module_metadata
9\keyword qt6_set_harmonyos_module_metadata
10
11\summary {Sets HarmonyOS module-level metadata on the target.}
12
13\include cmake-find-package-core.qdocinc
14
15\cmakecommandsince 6.12
16\preliminarycmakecommand
17\cmakecommandharmonyosonly
18
19\section1 Synopsis
20
21\badcode
22qt_set_harmonyos_module_metadata(target
23 [DESCRIPTION <description>]
24 [DEVICE_TYPES <type> [<type>...]]
25 [ORIENTATION <orientation>]
26)
27\endcode
28
29\versionlessCMakeCommandsNote qt6_set_harmonyos_module_metadata()
30
31\section1 Description
32
33The command sets module-level metadata for the HarmonyOS \c {target}
34executable. The values are conceptually module-scoped (they describe a single
35HAP module) and are written into \c {entry/src/main/module.json5} when the HAP
36package is built. Application-scoped metadata, such as the vendor or version, is
37set with \l{qt6_set_harmonyos_app_metadata}{qt_set_harmonyos_app_metadata()}
38instead. Options that are not specified leave the corresponding manifest field
39at its default.
40
41\section1 Arguments
42
43\c DESCRIPTION is the module description. It accepts either a literal string
44(which appears verbatim in the manifest and is not localizable) or a
45\c {$string:<name>} resource reference that resolves to a localized string from
46the application's resource files.
47
48\c DEVICE_TYPES is the list of HarmonyOS device-type identifiers that the
49module supports, for example \c tablet, \c {2in1}, or \c phone. When unset, a
50Qt-provided default is used.
51
52\c ORIENTATION sets the screen-orientation policy of the application's ability.
53When unset, the field is omitted from the manifest and the system default
54applies. The accepted values are the orientation strings defined by the
55HarmonyOS \c {module.json5} schema, including \c auto_rotation,
56\c auto_rotation_restricted, \c landscape, \c portrait,
57\c auto_rotation_landscape, \c auto_rotation_portrait, and \c locked. An
58unrecognized value is ignored with a warning at HAP build time.
59
60\section1 Example
61
62\snippet cmake-macros/examples.cmake qt_set_harmonyos_module_metadata
63
64\sa {qt6_set_harmonyos_app_metadata}{qt_set_harmonyos_app_metadata()},
65 {Qt for HarmonyOS CMake API}
66*/