From: Matt Keeter Date: Fri, 7 Mar 2014 17:19:38 +0000 (-0600) Subject: Adding quit action to file menu X-Git-Tag: v0.9.0~37 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=26a0a6eaf22d71ed5f075a38deb15de4de79b368;p=fstl Adding quit action to file menu --- diff --git a/src/window.cpp b/src/window.cpp index eb4d9dc..9d06449 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -21,8 +21,15 @@ Window::Window(QWidget *parent) : open_action->setShortcut(QKeySequence::Open); QObject::connect(open_action, SIGNAL(triggered()), this, SLOT(on_open())); + + QAction* quit_action = new QAction("Quit", this); + quit_action->setShortcut(QKeySequence::Quit); + QObject::connect(quit_action, SIGNAL(triggered()), + this, SLOT(close())); + auto file_menu = menuBar()->addMenu("File"); file_menu->addAction(open_action); + file_menu->addAction(quit_action); resize(600, 400); }