1.2 连接信号和响应函数
#include<QtGui/QApplication> #include<QPushButton> intmain(intargc,char*argv[]) { QApplicationapp(argc,argv); QPushButton*button=newQPushButton("Quit"); QObject::connect(button,SIGNAL(clicked()),&app,SLOT(quit())); button->show(); app.exec(); }