Chinaunix

标题: 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
//////////////////


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/56913/showart_681675.html




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2