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:
parent
ed5a96341b
commit
6d46f8c453
@ -22,6 +22,8 @@
|
|||||||
#include <QNetworkReply>
|
#include <QNetworkReply>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QSystemTrayIcon>
|
#include <QSystemTrayIcon>
|
||||||
|
#include <QShortcut>
|
||||||
|
#include <QApplication>
|
||||||
|
|
||||||
MainWindow *MainWindow::instance_ = nullptr;
|
MainWindow *MainWindow::instance_ = nullptr;
|
||||||
|
|
||||||
@ -84,6 +86,9 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
this,
|
this,
|
||||||
SLOT(showChatPage(QString, QString, QString)));
|
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;
|
QSettings settings;
|
||||||
|
|
||||||
if (hasActiveUser()) {
|
if (hasActiveUser()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user