程序如下:
#include "hello.h"
#include <QtGui/QApplication>
#include <QtGui/QWidget>
#include <QtGui/QLabel>
#include <QtCore/QTextCodec>
#include <QtGui/QPushButton>
#include <QtGui/QVBoxLayout>
//#include <QtUiTools>
hello::hello(QWidget *parent, Qt::WFlags flags)
: QWidget(parent, flags)
{
QTextCodec::setCodecForTr(QTextCodec::codecForName("gb18030"));
QUiLoader loader;
QFile file("D:\My Documents\projects\hello\hello.ui");
file.open(QFile::ReadOnly);
QWidget *formWidget = loader.load(&file, this);
file.close();
pushButton = qFindChild<QPushButton*>(this, "关闭哦");
label = qFindChild<QLabel*>(this,"同一个世界,同一个梦想~~!!!");
QObject::connect(pushButton,SIGNAL(clicked()),this,SLOT(close()));
ui.setupUi(this);
}
在windows下编译老出错: QUiLoader was not declare in this scope
../../tools/designer/src/uitools/quiloader.h :No such file or directory
请帮忙解释下到底是什么原因啊??