本页内容

入门

要验证 VS Code 的 Qt 扩展能否找到您的 Qt 安装路径和 CMake 工具包,请打开一个 Qt 示例进行编译和运行。

在 VS Code 中构建并运行 Qt 示例。

要在 VS Code 中打开并运行一个 Qt 示例项目:

  1. 安装 VS Code 的 Qt 扩展。
  2. 访问Welcome 。

    {欢迎页面}

  3. 选择“Examples ”以打开一个 Qt 示例。

    {Qt 示例列表}

    有关更多信息,请参阅《教程:构建和运行 Qt 示例》。

  4. 转到Command Palette ,然后选择“Qt: Register Qt installation ”以注册一个 Qt 版本。
  5. 访问Command Palette ,然后选择“Qt: Set the recommended Qt Extension settings ”(管理 Qt 版本),在状态栏中显示已注册的 Qt CMake 套件。
  6. 访问Command Palette 并选择Qt: Scan for kits 。然后选择一个与您的 Qt 版本和工具链匹配的套件。
  7. 在状态栏上选择“在终端窗口中启动所选目标 ”。
  8. 选择可执行文件作为启动目标,以构建并运行该项目。

现在,您可以选择一个教程来学习如何开发 Qt 应用程序。使用项目向导模板来创建您自己的应用程序项目。

注册 Qt Academy 课程

访问Welcome ,然后选择“Qt academy ”浏览课程。

{Qt Academy 课程列表}

您可以:

  • 搜索课程。
  • 按类型和级别筛选课程。
  • 按名称及其他标准对课程进行排序。
  • 访问 Qt Academy 以浏览完整的课程目录。

另请参阅 “安装”、“注册 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.