全部博文(333)
分类: C/C++
2012-09-22 08:20:09
下面是qt3与qt4的举例
qt3下面的源程序是:
#include <>
#include <>
#include <>
#include <>
int main( int argc, char **argv )
{
a( argc, argv );
box;
box.( 200, 120 );
quit( "Quit", &box );
quit.( QFont( "Times", 18, QFont::Bold ) );
QObject::( &quit, SIGNAL(()), &a, SLOT(()) );
a.( &box );
box.();
return a.();
}
在qt4中修改为:
#include
#include
#include
#include
int main( int argc, char **argv )
{
QApplication a( argc, argv );
Q3VBox box;
box.resize( 200, 120 );
QPushButton quit( "Quit", &box );
quit.setFont( QFont( "Times", 18, QFont::Bold ) );
QObject::connect( &quit, SIGNAL(clicked()), &a, SLOT(quit()) );
a.setMainWidget( &box );
box.show();
return a.exec();
}