From 6d46f8c45336364694e365858656f6bf1b905afe Mon Sep 17 00:00:00 2001 From: Max Sandholm Date: Sat, 23 Sep 2017 21:53:19 +0300 Subject: [PATCH] Ctrl-Q from the main window now quits the application. Not tested on macOS, does it need to be separately handled? Not tested on Windows either... --- src/MainWindow.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/MainWindow.cc b/src/MainWindow.cc index 21f4c732..3187b953 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc @@ -22,6 +22,8 @@ #include #include #include +#include +#include MainWindow *MainWindow::instance_ = nullptr; @@ -84,6 +86,9 @@ MainWindow::MainWindow(QWidget *parent) this, SLOT(showChatPage(QString, QString, QString))); + QShortcut *quitShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this); + connect(quitShortcut, &QShortcut::activated, this, [=]() { QApplication::quit(); }); + QSettings settings; if (hasActiveUser()) {