diff options
author | Taeyeon Mori <orochimarufan.x3@gmail.com> | 2014-04-17 14:49:03 +0200 |
---|---|---|
committer | Taeyeon Mori <orochimarufan.x3@gmail.com> | 2014-04-17 14:49:03 +0200 |
commit | 0b60e50af8d2752210fdf9ccc3f6d97486a30b01 (patch) | |
tree | 991882f1ec238a61e0f3ecb5c1a4754972ecd9fb | |
parent | bf1632e4ed09f3fdc140b25a67b82f2bedb66f76 (diff) | |
download | MultiMC-0b60e50af8d2752210fdf9ccc3f6d97486a30b01.tar MultiMC-0b60e50af8d2752210fdf9ccc3f6d97486a30b01.tar.gz MultiMC-0b60e50af8d2752210fdf9ccc3f6d97486a30b01.tar.lz MultiMC-0b60e50af8d2752210fdf9ccc3f6d97486a30b01.tar.xz MultiMC-0b60e50af8d2752210fdf9ccc3f6d97486a30b01.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)
-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 |