QT工具栏开始,退出 //初始化场景 QMenuBar *bar = menuBar(); setMenuBar(bar); QMenu *startbar = bar->addMenu("开始"); QAction * quitAction = startbar->addAction("退出"); connect(quitAction , &QAction::triggered,[=](){ this->close(); });