HarmonyOS 版 Qt
注意: HarmonyOS 版Qt 目前处于技术预览阶段,未来版本中可能会发生变更。
Qt for HarmonyOS 使您能够为 HarmonyOS 设备开发 Qt 应用程序。
HarmonyOS 版 Qt 提供了平台集成、构建和打包支持,以及将跨平台 Qt 库(如Qt Core 、Qt GUI 、Qt Quick 和Qt Widgets )连接到 HarmonyOS 的平台插件。Qt 应用程序被打包为 HarmonyOS 能力包 (HAP),并通过 HarmonyOS 平台插件在设备上运行。
主要特点与功能
- 跨平台开发。只需编写一次应用程序代码(通常是采用 C++ 后端的Qt Quick 应用程序),即可将其部署到 HarmonyOS 以及 Qt 支持的其他平台上,且几乎无需或完全无需调整。
- 原生性能。Qt 运行时针对 HarmonyOS 进行了编译,因此可在设备上作为原生代码运行。
- 丰富的 UI 组件。使用 Qt Quick 和 Qt Quick Controls 构建响应式界面,或 Qt Widgets 构建传统的基于控件的用户界面。
- C++ 集成。复用现有的 C++ 库和高性能原生代码。
探索适用于 HarmonyOS 的 Qt
要了解如何使用 Qt for HarmonyOS 进行开发,请参阅以下主题:
- Qt for HarmonyOS 先决条件
- Qt for HarmonyOS - 从源代码构建
- 构建和部署 HarmonyOS 版 Qt 应用程序
- HarmonyOS 版 Qt 的 CMake API
- harmonyostestrunner 工具
支持的配置
在 Windows(x86_64)/Linux(x86_64)/macOS(x86_64)/macOS(Apple Silicon) 开发主机上支持使用 Qt for HarmonyOS 进行构建和开发。
此 Qt 版本支持以下配置:
| 章节 | 描述 |
|---|---|
| 发行版 | HarmonyOS 6.1.0(API 23)及更高版本 |
| 架构 | arm64-v8a |
| 编译器 | Clang 15.0.4 (SDK 6.1.0) 注意:建议 Qt 应用使用与构建官方 Qt for HarmonyOS 库时相同的 SDK 版本,以避免出现符号缺失错误。 |
| 目标 | 华为 HarmonyOS 电脑/平板/手机 |
注意: 计划在未来切换至较新的 HarmonyOS 版本。
© 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.