标题: Button [打印本页] 作者: happypeter 时间: 2008-05-09 09:35 标题: Button #include
#include
int main(int argc, **argv)
{
QApplication app(argc,argv);
QPushButton *b;
b=new QPushButton("hello",0); //error if 0 is missed.
//new returns a pointer to a object, thus *b can be taken as the class itself
app.setMainWidget(b);
b->show();
//b is a pointer so ->, app is the object so .
return app.exec();
}
///////////////
//b->setIconSet(QPixmap::fromMimeSource(wgz.png));
//b->setGeometry(20,20,30,30); //note 4 parameter are needed
//the lines works
//////////////////