Qt中从.ui文件生成.h文件
2010-03-01 23:28
411 查看
// 此main函数的作用是将Qt designer设计的好的
// 界面的ui文件生成.h文件
#include <qapplication.h>
#include <qwidget.h>
// 文件格式名为 ui_***.h 其中***为ui文件的名字部分
// 例如 a.ui 的头文件为 ui_a.h
#include "ui_dictationtexteditor.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
Ui::dictationTextEditor ui;
// 如果设计的是dialog这里改为QDialog即可
QWidget* widget = new QWidget;
ui.setupUi(widget);
widget->show();
return app.exec();
}
// 界面的ui文件生成.h文件
#include <qapplication.h>
#include <qwidget.h>
// 文件格式名为 ui_***.h 其中***为ui文件的名字部分
// 例如 a.ui 的头文件为 ui_a.h
#include "ui_dictationtexteditor.h"
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
Ui::dictationTextEditor ui;
// 如果设计的是dialog这里改为QDialog即可
QWidget* widget = new QWidget;
ui.setupUi(widget);
widget->show();
return app.exec();
}
相关文章推荐
- QT:直接使用ui文件生成h文件的方法
- Qt 生成ui对应的h文件和cpp文件的方法
- qt 将.ui文件生成.h或.cpp文件
- vs环境下QT新建.ui文件无法自动生成ui_xxx.h
- QT5 执行qmake 的时候不能为xxx.ui生成ui_xxx.h 文件
- vs中结合Qt的UI文件生成moc文件的方法
- 将QT里的.ui生成.h文件,并在.cpp中对.ui中的控件写事件及支持中文
- 如何利用QT设计师设计的ui生成相应头文件
- Qt5 由.ui文件生成.pro文件和C++文件
- Qt由ui文件生成.h和.cpp文件的方法
- C++ Qt GUI 将Qt设计师生成的**.ui文件转为ui_**.h
- Qt由ui文件生成.h和.cpp文件的方法
- 指定Qt编译临时文件生成目录
- ui文件生成.h文件.txt
- QT(2):添加ui文件及构建ui文件的头文件说明
- Qt探秘——谈ui文件的用法
- QT生成在Windows下有图标的exe文件(IDE=QT Creator)
- qt 生成库文件
- Qt工程没有对应生成moc文件
- Qt探秘——谈ui文件的用法