summary refs log tree commit diff
path: root/src/MainWindow.cc
diff options
context:
space:
mode:
authorMax Sandholm <max@sandholm.org>2017-09-24 13:58:36 +0300
committermujx <mujx@users.noreply.github.com>2017-09-24 13:58:36 +0300
commitb1214a9ae8b6da5ddbd71ce3507399a76a199886 (patch)
tree2633bae6f746379b5ffd1f2679b4e53f66ca667d /src/MainWindow.cc
parentProperly handle html tags (diff)
downloadnheko-b1214a9ae8b6da5ddbd71ce3507399a76a199886.tar.xz
Ctrl-Q from the main window quits the application (#69)
Ctrl-Q from the main window now quits the application.

fixes #61 
Diffstat (limited to 'src/MainWindow.cc')
-rw-r--r--src/MainWindow.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/MainWindow.cc b/src/MainWindow.cc

index 21f4c732..364e6d66 100644 --- a/src/MainWindow.cc +++ b/src/MainWindow.cc
@@ -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::Quit, this); + connect(quitShortcut, &QShortcut::activated, this, QApplication::quit); + QSettings settings; if (hasActiveUser()) {