mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
[UI] Also accept completion on focus out when none selected
This commit is contained in:
parent
66efebe87a
commit
b8b04f9a7a
1 changed files with 7 additions and 1 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue