From f9f634b326f359e9f605c1215f94670053d57069 Mon Sep 17 00:00:00 2001 From: Igor Kushnir Date: Sun, 17 Nov 2019 15:26:49 +0200 Subject: [PATCH] fix(ui): quit qTox on Ctrl+Q when "Close to tray" is enabled Fixes #5925. --- src/widget/widget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widget/widget.cpp b/src/widget/widget.cpp index 89a072a60..a0279d781 100644 --- a/src/widget/widget.cpp +++ b/src/widget/widget.cpp @@ -334,7 +334,8 @@ void Widget::init() // initial request with the sanitized name so there is no work for us to do // keyboard shortcuts - new QShortcut(Qt::CTRL + Qt::Key_Q, this, SLOT(close())); + auto* const quitShortcut = new QShortcut(Qt::CTRL + Qt::Key_Q, this); + connect(quitShortcut, &QShortcut::activated, qApp, &QApplication::quit); new QShortcut(Qt::CTRL + Qt::SHIFT + Qt::Key_Tab, this, SLOT(previousContact())); new QShortcut(Qt::CTRL + Qt::Key_Tab, this, SLOT(nextContact())); new QShortcut(Qt::CTRL + Qt::Key_PageUp, this, SLOT(previousContact()));