[UI] Also accept completion on focus out when none selected

This commit is contained in:
Lukas Brübach 2026-10-09 12:41:59 +02:00
parent 66efebe87a
commit b8b04f9a7a

View file

@ -62,8 +62,14 @@ void LineEditCompleter::focusOutEvent(QFocusEvent *e)
} }
const QModelIndex currentIndex = info.completer->popup()->currentIndex(); const QModelIndex currentIndex = info.completer->popup()->currentIndex();
QString completionText;
if (currentIndex.isValid()) { if (currentIndex.isValid()) {
insertCompletion(info.completer, currentIndex.data().toString()); completionText = currentIndex.data().toString();
} else {
completionText = info.completer->currentCompletion();
}
if (!completionText.isEmpty()) {
insertCompletion(info.completer, completionText);
} }
} }