mirror of
https://github.com/zealdocs/zeal.git
synced 2024-07-14 17:40:31 +03:00
fix(ui): use async selection in search edit
The smart selection logic implemented for #1033, for some reason did not work for Ctrl+K. Calling selectAll() asynchronously fixes that. Related to #703.
This commit is contained in:
parent
1d92d3c737
commit
d5ce8a0f04
@ -29,6 +29,7 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QLabel>
|
||||
#include <QStyle>
|
||||
#include <QTimer>
|
||||
|
||||
using namespace Zeal;
|
||||
using namespace Zeal::WidgetUi;
|
||||
@ -82,7 +83,8 @@ void SearchEdit::selectQuery()
|
||||
return;
|
||||
}
|
||||
|
||||
selectAll();
|
||||
// Avoid some race condition which breaks Ctrl+K shortcut.
|
||||
QTimer::singleShot(0, this, &QLineEdit::selectAll);
|
||||
}
|
||||
|
||||
bool SearchEdit::event(QEvent *event)
|
||||
|
Loading…
Reference in New Issue
Block a user