mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 19:13:25 -08:00
[UI] Defer refocus on Tab to avoid focus chain issues
This commit is contained in:
parent
4b7aa8f1c2
commit
4607b7d3ad
1 changed files with 2 additions and 1 deletions
|
|
@ -71,7 +71,8 @@ void LineEditCompleter::focusOutEvent(QFocusEvent *e)
|
||||||
|
|
||||||
if (popupWasVisible && e->reason() == Qt::TabFocusReason) {
|
if (popupWasVisible && e->reason() == Qt::TabFocusReason) {
|
||||||
// Refocus the edit so Tab doesn't move focus away
|
// Refocus the edit so Tab doesn't move focus away
|
||||||
setFocus();
|
// Use a queued connection to ensure focus is restored after the focus change completes
|
||||||
|
QMetaObject::invokeMethod(this, "setFocus", Qt::QueuedConnection);
|
||||||
e->accept();
|
e->accept();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue