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)
This commit is contained in:
Taeyeon Mori 2014-04-17 14:49:03 +02:00
parent bf1632e4ed
commit 0b60e50af8

View File

@ -35,6 +35,7 @@
#include <QToolButton> #include <QToolButton>
#include <QWidgetAction> #include <QWidgetAction>
#include <QProgressDialog> #include <QProgressDialog>
#include <QShortcut>
#include "osutils.h" #include "osutils.h"
#include "userutils.h" #include "userutils.h"
@ -116,6 +117,12 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
// OSX magic. // OSX magic.
// setUnifiedTitleAndToolBarOnMac(true); // setUnifiedTitleAndToolBarOnMac(true);
// Global shortcuts
{
auto q = new QShortcut(QKeySequence::Quit, this);
connect(q, &QShortcut::activated, qApp, &QCoreApplication::quit);
}
// The instance action toolbar customizations // The instance action toolbar customizations
{ {
// disabled until we have an instance selected // disabled until we have an instance selected