创建 UI 表单文件
使用Qt Widgets Designer 设计基于部件的用户界面。
要在项目中添加新的.ui 文件,请访问Project >Add New Item >Installed >Visual C++ >Qt >。 Qt Widgets Form File.

通常,您需要将为表单文件生成的代码封装到QWidget 子类中,以便为其添加信号或插槽。因此,Qt XML VS Tools 会为您创建.h 和.cpp 文件,以及一个空的 UI 表单。
另请参阅 教程:Qt Widgets 应用程序、启动Qt Widgets Designer 和Qt Widgets Designer 手册。
© 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.