1. 信号槽
int main(int argc, char *argv[]) { QApplication app(argc, argv); QPushButton button("Quit"); QObject::connect(&button, &QPushButton::clicked, &QApplication::quit); button.show(); return app.exec(); }