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:
Oleg Shparber 2023-10-05 02:57:57 -04:00
parent 1d92d3c737
commit d5ce8a0f04

View File

@ -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)