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...
This commit is contained in:
Max Sandholm 2017-09-23 21:53:19 +03:00
parent ed5a96341b
commit 6d46f8c453

View File

@ -22,6 +22,8 @@
#include <QNetworkReply>
#include <QSettings>
#include <QSystemTrayIcon>
#include <QShortcut>
#include <QApplication>
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()) {