QT学习(对话框)codeblock版本

参考:

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

image

生成资源的.h文件uic -o ui_dig1.h dig1.ui

 

image

代码:

#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();
}

运行结果:

image

posted @ 2013-12-29 18:31  小菜鸟_yang  阅读(440)  评论(0编辑  收藏  举报