[UI] Defer refocus on Tab to avoid focus chain issues

This commit is contained in:
Lukas Brübach 2026-10-09 13:48:58 +02:00
parent 4b7aa8f1c2
commit 4607b7d3ad

View file

@ -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;
} }