我自己写了下,总是不行:
#include
#include
#include
int main( int argc, char **argv )
{
QApplication a( argc, argv );
QPushButton *hello=new QPushButton( "Hello world!", 0 );
hello->resize( 100, 30 );
a.setMainWidget( hello );
hello->show();
QMessageBox *mb=new QMessageBox(NULL,"abcdefg");
QObject::connect( hello, SIGNAL(pressed ()),mb,
SLOT(about(NULL, "Qt Application Example","fjkasdhfkjsd")) );
return a.exec();
}
编译链接是成功的,运行能显示Button,就是按钮后没反应,唉!