]> git.sur5r.net Git - fstl/commitdiff
Adding quit action to file menu
authorMatt Keeter <matt.j.keeter@gmail.com>
Fri, 7 Mar 2014 17:19:38 +0000 (11:19 -0600)
committerMatt Keeter <matt.j.keeter@gmail.com>
Fri, 7 Mar 2014 17:19:38 +0000 (11:19 -0600)
src/window.cpp

index eb4d9dc862ca5c452065cbb3afe887f393653284..9d0644924c1dcf30e9d6a0c1bc5cc7cd5672afd8 100644 (file)
@@ -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);
 }