class qt_test : public QMainWindow{ Q_OBJECTpublic: qt_test(QWidget *parent = 0); ~qt_test();private: Ui::qt_testClass ui;[b]private slots: void on_btnExit_clicked() {close();} void on_actionExit_toggled(bool checked) {close();}[/b]};
qt_test::qt_test(QWidget *parent) : QMainWindow(parent){ ui.setupUi(this); connect(ui.actionExit,SIGNAL(toggled(bool)),this,SLOT(on_actionExit_toggled(bool)));}
connect(ui.actionExit,SIGNAL(triggered()),this,SLOT(close()));
on_actionExit_triggered() {...}
connect(ui.actionExit,SIGNAL(triggred()),this,SLOT(close()));
class qt_test : public QMainWindow, private Ui::qt_testClass{....};