Qbs 联编配置
要指定所选工具包的构建设置,请访问Projects >Build Settings 。

Qbs 会在Build directory 中指定的目录下构建项目。
在Tooltip in target selector 中,当您将鼠标悬停在工具包选择器中的构建配置上时,输入的文本将显示为工具提示。
您可以在Configuration name 中输入构建配置的名称。
有关配置 Qbs 的更多信息,请参阅首选项:Qbs。
分离调试信息
如果正在生成调试信息,您可以在Separate debug info 中选择Enable ,将其放置到单独的文件中,而不是嵌入到二进制文件中。更多信息,请参阅分析 CPU 使用情况。要使用默认设置,请选择Default 。
编译 QML
您可以将 QML 源代码编译到最终二进制文件中,以缩短应用程序的启动时间,并且无需将 QML 文件与应用程序一起部署。更多信息,请参阅提前编译。
Qt Creator 项目向导模板可创建可编译的Qt Quick 项目,因为它们已设置为使用 Qt XML 资源系统。要编译 QML 代码,请选择Enable 。 Qt Quick Compiler.要使用默认设置,请选择Default 。
Qbs 构建步骤

要指定 Qbs 的编译步骤,请在
- 在Build variant 中,选择 :
- Debug 以在构建中包含调试符号,用于调试程序。
- Profile 为优化的发布版构建提供单独的调试信息。它最适合分析应用程序。
- Release 创建最终安装二进制包。
- 在Parallel jobs 中,指定用于构建的并行作业数量。
- 在Properties 中,指定要传递给项目的属性。使用冒号 (:) 分隔键和值。更多信息,请参阅Qbs:模块。
- 在Flags 中,选择
- Keep going 尽可能在出错时继续编译。
- Show command lines 在编译输出(Compile Output)中打印实际命令行,而不是高级描述。
- Force probes 强制重新执行QbProbes 的配置脚本。
- 在Installation flags :
- 选择Install ,在编译后将工件复制到安装位置。该选项默认为启用。
注意: 在 Windows 系统中,如果应用程序正在运行,则构建将失败,因为可执行文件无法覆盖。为避免此问题,可清除此复选框,并在运行设置中添加Qbs Install 部署步骤,该步骤将在运行应用程序之前执行。
- 选择Clean install root 可在构建开始前删除安装根目录的内容。
- 选择Use default location 可将工件安装到默认位置。清除复选框可在Installation directory 中指定其他位置。
- 选择Install ,在编译后将工件复制到安装位置。该选项默认为启用。
Equivalent command line 显示根据所选选项构建的构建命令。
Qbs 清理步骤
使用 Qbs 构建时,可以在Clean Steps 中指定标记:

- 选择Dry run 可在不执行命令或永久更改构建图的情况下测试清理。
- 如果可能,选择Keep going 可在出现错误时继续清理。
Equivalent command line 显示根据所选选项构建的清理命令。
Copyright © The Qt Company Ltd. and other contributors. 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.