编译 Qt 源代码
您可以通过编译 Qt 源代码来安装 Qt。例如,在以下情况下,此方法非常有用:
- 您需要自定义构建(例如,应用补丁或启用调试选项)。
- 您的平台不受预编译软件包支持。
- 您正在为 Qt 做出贡献或调试其内部实现。
注意: 除上述情况外,在 大多数情况下,安装 Qt 的最佳方式是访问Qt Online Installer 。请参阅《通过Qt Online Installer 获取并安装 Qt》。
不同 Qt 平台的安装步骤各不相同。本页面提供了受支持平台的相关信息,以及各模块系统要求的链接。
一般安装信息
当您编译 Qt 源代码时,需使用configure工具为特定平台配置 Qt,并指定特定的 Qt 功能或模块集。有关更多信息,请参阅《Qt 配置选项》。
构建与安装流程
构建和安装流程简要概述:
- 下载 Qt 源代码并设置初始环境。
- 根据使用场景配置构建,例如在主机系统上进行开发,或针对目标平台进行交叉编译。
- 在单独的目录中进行构建(编译)。
- 可选。安装已构建的成果。
特定平台的安装信息
Windows
macOS
Linux
嵌入式 Linux
Android
iOS
特定模块的系统要求
其他信息
顶级 qt5 Git 仓库包含一组以配置脚本形式呈现的构建说明,Qt 的持续集成(CI)系统使用这些脚本来构建和测试受支持的平台。这些脚本对任何从源代码构建 Qt 的人都很有用,因为它们提供了每种配置所需的工具和组件的信息。
© 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.