教程:构建并运行 Qt 示例
本教程将演示如何在 VS Code 中打开 Qt 示例。要测试 Qt Online Installer 安装是否成功,请打开一个现有的示例应用程序项目,然后对其进行构建并运行。
开始之前
开始之前,您需要:
打开一个 Qt 示例
- 访问Welcome ,然后选择“Examples ”。

如果看不到任何示例,请检查Qt versions 中的列表是否为空。
- 从示例列表中选择一个示例。
您还可以使用标签来筛选示例。
- 选择“New project ”以基于示例项目创建一个新项目。

- 在“Name ”中,输入项目名称。
- 选择“Open in new window ”。

- 选择一个套件来构建和运行该项目。
- 在状态栏上选择“
”。 - 选择可执行文件作为启动目标,以构建和运行该项目。
另请参阅 “安装”、“注册 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.