From 0b60e50af8d2752210fdf9ccc3f6d97486a30b01 Mon Sep 17 00:00:00 2001 From: Taeyeon Mori Date: Thu, 17 Apr 2014 14:49:03 +0200 Subject: [PATCH] Add a quit shortcut to the main window (#200) The shortcut is Ctrl+Q on every platform but windows, which doesn have one. See also: http://qt-project.org/doc/qt-5/qkeysequence.html#details (StandardKey Quit) --- gui/MainWindow.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index dcb6d3b5..2e70a6a6 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include "osutils.h" #include "userutils.h" @@ -116,6 +117,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi // OSX magic. // setUnifiedTitleAndToolBarOnMac(true); + // Global shortcuts + { + auto q = new QShortcut(QKeySequence::Quit, this); + connect(q, &QShortcut::activated, qApp, &QCoreApplication::quit); + } + // The instance action toolbar customizations { // disabled until we have an instance selected