解决方案: 在对应工程的*.pro文件里加上: QT+= widgets 则在编译过程中对应的“xxx.ui”文件会自动生成“ui_xxx.h”文件。 转载于:https://www.cnblogs.com/airscrat/p/7267441.html