mirror of
https://github.com/zealdocs/zeal.git
synced 2024-11-27 11:44:56 +03:00
Make escape work everywhere
This commit is contained in:
parent
c4387ca9b7
commit
ae96efc4f4
@ -25,6 +25,7 @@
|
||||
#include <QFutureWatcher>
|
||||
#include <QWebFrame>
|
||||
#include <QWebElement>
|
||||
#include <QShortcut>
|
||||
#include <quazip/quazip.h>
|
||||
#include "JlCompress.h"
|
||||
|
||||
@ -444,6 +445,13 @@ void MainWindow::setupShortcuts()
|
||||
connect(focusSearch, &QShortcut::activated, [=]() {
|
||||
ui->lineEdit->setFocus();
|
||||
});
|
||||
|
||||
QShortcut* globalEsc = new QShortcut(QKeySequence("Esc"), this);
|
||||
globalEsc->setContext(Qt::ApplicationShortcut);
|
||||
connect(globalEsc, &QShortcut::activated, [=]() {
|
||||
ui->lineEdit->setFocus();
|
||||
ui->lineEdit->clearQuery();
|
||||
});
|
||||
}
|
||||
|
||||
void MainWindow::setHotKey(const QKeySequence& hotKey_) {
|
||||
|
Loading…
Reference in New Issue
Block a user