#include <qpushbutton.h>
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton hello( "Hello world!", 0 );
hello.resize( 100, 30 );
a.setMainWidget( &hello );//設置應用程序的主窗口部件爲mainWidget
hello.show();
return a.exec();
}
學習過程中一定要參考數據手冊,通過查閱數據手冊才知道頭函數等等的編寫 ,要不會犯很多的錯誤的