在此页面上

如何

以下主题介绍了如何设置 Qt VS 工具以及如何使用它们创建、构建、调试和本地化 Qt 应用程序。

设置 Qt VS 工具

在 Microsoft Visual Studio 中安装 Qt VS Tools,然后告诉它在哪里可以找到要使用的 Qt 版本。

创建

使用向导创建几种类型的 Qt 和Qt Quick 项目以及添加到项目中的文件,如类、窗体文件或自定义 QML 类型。

编辑

通过 IntelliSense 信息和QML Language Server 支持,您可以获得 C++ 和 QML 类型的代码编辑功能。

构建

Qt VS Tools 与 MSBuild 集成,因此你可以将 Qt 应用程序作为 Visual Studio 项目来构建。名为Qt/MSBuild的特殊构建规则可让你运行 Qt 构建工具并为其设置构建选项。

调试

使用调试器,您可以查看应用程序运行时或崩溃时发生的情况。您可以调试Qt Widgets 和Qt Quick 应用程序。

测试

使用 Qt 测试框架 QtTest 对基于 Qt 的应用程序和库进行单元测试。编写测试、使用测试资源管理器、创建测试套件和测试图形用户界面。

本地化

使用 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.