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