|
我想在这个程序中改按钮大小,为什么没反应?
quit.resize(50,30);
这句没反应。
/**************************/
#include <qapplication.h>
#include <qpushbutton.h>
#include <qfont.h>
#include <qvbox.h>
#include<iostream>
using namespace std;
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QVBox box;
box.resize( 200, 120 );
QPushButton quit( "Quit", &box );
quit.setFont( QFont( "Times", 18, QFont::Bold ) );
quit.resize(50,30);
QObject::connect( &quit, SIGNAL(clicked()), &a, SLOT(quit()) );
cout<<"i love you";
a.setMainWidget( &box );
box.show();
return a.exec();
} |
|