diff options
author | Taeyeon Mori <orochimarufan.x3@gmail.com> | 2014-04-17 14:49:03 +0200 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2014-04-21 21:37:15 +0200 |
commit | adecc53df8a6ba3dbddb5d6c46e58c751453dd81 (patch) | |
tree | 7cd612692f13c08086864278abf0795277a65cce /gui | |
parent | c9465e9e864497e8fe1b97b2a776c48ccacad6d9 (diff) | |
download | MultiMC-adecc53df8a6ba3dbddb5d6c46e58c751453dd81.tar MultiMC-adecc53df8a6ba3dbddb5d6c46e58c751453dd81.tar.gz MultiMC-adecc53df8a6ba3dbddb5d6c46e58c751453dd81.tar.lz MultiMC-adecc53df8a6ba3dbddb5d6c46e58c751453dd81.tar.xz MultiMC-adecc53df8a6ba3dbddb5d6c46e58c751453dd81.zip |
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)
Diffstat (limited to 'gui')
-rw-r--r-- | gui/MainWindow.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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 <QToolButton> #include <QWidgetAction> #include <QProgressDialog> +#include <QShortcut> #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 |