参考:
http://www.cnblogs.com/JohnShao/archive/2011/09/26/2191627.html
http://www.cnblogs.com/xiao-cheng/archive/2012/01/17/2325106.html
http://www.cnblogs.com/lnstree/articles/2971739.html
设计界面,打开QTdesigner,保存为dig1.ui
生成资源的.h文件uic -o ui_dig1.h dig1.ui
代码:
#include <QApplication>
#include "ui_dig1.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Ui_Dialog ui;
QDialog *dlg=new QDialog;
ui.setupUi(dlg);
dlg->show();
return app.exec();
}
运行结果: