HarmonyOS 版 Qt 的先决条件
注意: HarmonyOS 版Qt 目前处于技术预览阶段,未来版本可能会有变动。
要开发 HarmonyOS 版的 Qt 应用程序,您需要在开发主机上安装 OpenHarmony SDK 及相关命令行工具。
无论您是从源代码构建HarmonyOS 版 Qt,还是使用预编译的 HarmonyOS 版 Qt 来构建和部署自己的应用程序,所需的先决条件都是一样的。
先决条件
- OpenHarmony SDK 命令行工具,该工具提供编译器工具链、系统库以及用于组装 HarmonyOS 能力包 (HAP) 的
hvigor构建工具。 - 可选:DevEco Studio(HarmonyOS的官方IDE),便于在设备或模拟器上运行和调试应用程序。
支持的开发主机
Qt for HarmonyOS 工具链目前在 Linux 系统上进行开发和测试。
设置 SDK
安装 OpenHarmony SDK 命令行工具后,需将 Qt 指向 SDK,以便构建系统能够定位工具链和系统库。无论是在源代码级别配置 Qt for HarmonyOS 构建,还是基于预编译的 Qt 构建应用程序,此步骤都是必需的。您可以通过以下两种方式完成:
- 将
OHOS_SDK_ROOT环境变量设置为SDK根路径。 - 使用
-ohos-sdk选项将路径传递给configure。
© 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.