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:
parent
c9465e9e86
commit
adecc53df8
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user