本页内容

创建 Qt 项目

要创建项目,请为特定项目类型选择一个预设:

  1. 转到“Welcome ”,然后选择“New project ”。
  2. 在“Project ”中,选择项目类型。

    {创建新项目或文件}

  3. 在“Name ”中,输入项目名称。
  4. 在“Create in ”中,输入项目文件的路径。例如,C:\Qt\examples 。
  5. 在“Options ”中,根据项目类型设置选项。
  6. 选择“Open in new window ”以创建项目文件,并在新的 VS Code 窗口中打开它们。要将新项目添加到工作区,请选择“Add to workspace ”。
  7. 为该项目选择一个 CMake 套件。

要设置“Create in ”中默认显示的项目文件夹,请转到“Command Palette ”,然后选择“Open Qt settings ”。

创建自定义预设

当您更改项目或文件类型的“Options ”时,可选择“Create ”来创建自定义预设。自定义预设会显示在预设列表中,您可以选择它们来创建新项目或文件。

要保存对自定义预设所做的更改,请选择“Save ”。

另请参阅 教程:《Qt Widgets 应用程序》、《将文件添加到项目》和《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.