概述
借助 Qt Extension for VS Code,您可以开发基于小部件的Qt Widgets 应用程序 Qt Quick 桌面及 Web 应用程序。

您可以根据所开发的应用程序类型,安装 Qt 扩展包和单个扩展。
C++ 开发
借助 Qt C++ 扩展包,您可以:
- 使用基于Qt Widgets 的用户界面创建 Qt 应用程序
- 通过选择生成的 Qt 套件,在您的 CMake 项目中使用 Qt
- 为 Qt 特定文件格式获取语法高亮和代码补全功能
- 使用Qt Widgets Designer设计基于Qt控件的用户界面
- 使用CMake构建 Qt 项目
- 调试 Qt 的 C++ 类型
- 阅读Qt 文档
Qt Quick 开发
借助Qt Qml 扩展,您可以:
- 创建Qt Quick 应用程序
- 通过以下方式获得 QML 语法高亮和代码补全功能 QML Language Server
- 使用qmllint验证 QML 代码的语法
- 利用以下功能查找Qt Quick 应用程序中典型性能问题的根源QML Profiler
Web 开发
借助Qt for WebAssembly扩展包,您可以:
- 通过选择生成的 Qt 套件,在您的 CMake 项目中使用 Qt
- 为 Qt 专用的文件格式获取语法高亮和代码补全功能
- 使用 CMake 构建 Qt 项目
- 调试 Qt for WebAssembly 代码
- 阅读 Qt 文档
Python 开发
借助 Qt Python 扩展包,您可以使用 Qt for Python 应用程序:
- 安装 PySide6 软件包
- 使用基于Qt Quick 或Qt Widgets 的用户界面创建Qt for Python 应用程序
- 构建、运行和清理应用程序
- 使用
debugpy和QML调试器调试应用程序 - 阅读Qt for Python 文档
使用数据收集
VS Code 的 Qt 扩展会收集有关您使用情况的匿名数据,以帮助 Qt 改进该扩展:
- 您计算机上的操作系统
- VS Code 的 Qt 扩展版本
- Visual Studio Code 版本
- 您激活扩展的日期和时间,以及激活总次数
- 您运行 VS Code 的 Qt 扩展命令的日期和时间,以及每次运行该命令的总次数
- 您为 VS Code 的 Qt 扩展指定的一些设置值
- 异常
- 下载QML Language Server 的日期和时间,以及总下载次数
- 您用于构建项目的 CMake kit 工具链名称和所使用的 Qt 版本
Qt Extension for VS Code 绝不会收集以下数据:
- 源代码
- 文件路径
- 项目的文件夹结构
- 您为 VS Code 或除“VS Code 的 Qt 扩展”以外的其他插件指定的设置值
- 构建输出
另请参阅 《安装和设置 Python 开发环境》。
© 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.