在本页中

构建 Qt 源代码

您可以通过构建 Qt 源码来安装 Qt。这在以下情况下非常有用

  • 您需要自定义构建(例如,带有补丁或调试选项)。
  • 您的平台不支持预编译包。
  • 您正在为 Qt 做出贡献或调试其内部结构。

注: 除上述情况外,在大多数情况下,安装 Qt 的最佳方法是使用Qt Online Installer 。请参见通过 Qt Online Installer 获取并安装 Qt

每个 Qt 平台的安装程序都不同。本页提供受支持平台的相关信息,以及特定模块系统要求的链接。

一般安装信息

当您构建 Qt 源代码时,您会使用configure工具为特定平台配置特定 Qt 功能或模块集的 Qt。有关详细信息,请参阅Qt 配置选项

构建和安装过程

简要介绍构建和安装过程:

  1. 下载 Qt 源代码并设置初始环境。
  2. 根据使用情况配置联编,如在主机系统上开发或在目标平台上交叉编译。
  3. 在单独的目录中构建(编译)。
  4. 可选。安装构建的工件。

特定平台安装信息

Windows

macOS

Linux

嵌入式 Linux

安卓

iOS

特定模块的系统要求

附加信息

顶级 qt5 Git 代码库包含一组以配置脚本provisioning scripts)为形式的构建说明,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.