最近用QT进行编程,用vc和qt4.0.1
程序如下:
#include <qapplication.h>
#include <qlabel.h>
int main(int argc,char **argv)
{
QApplication app(argc,argv);
QLabel *hello=new QLabel("<font color-blue>Hello <i>Qt!</i>""</font>",0);
app.setMainWidget(hello);
hello->show();
return app.exec();
}
一个很普通的程序,上面这个程序在编译的时候出现了这样的错误:
d:\program\cpp3.cpp(7) : error C2039: 'setMainWidget' : is not a member of 'QApplication'
有没有人知道这是什么原因造成的?
[ 此贴被fanyu在2005-10-24 13:21重新编辑 ]