mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-04-05 00:35:46 -05:00
Only emit signals if valid entry was found
This commit is contained in:
parent
93f96ee660
commit
d9c1ef4c22
|
|
@ -70,6 +70,9 @@ void FilterComboBox::CompleterHighlightChanged(const QModelIndex &index)
|
|||
_lastCompleterHighlightRow = index.row();
|
||||
const auto text = currentText();
|
||||
int idx = findXthOccurance(this, _lastCompleterHighlightRow, text);
|
||||
if (idx == -1) {
|
||||
return;
|
||||
}
|
||||
emit currentIndexChanged(idx);
|
||||
emit currentTextChanged(text);
|
||||
}
|
||||
|
|
@ -80,6 +83,9 @@ void FilterComboBox::TextChagned(const QString &text)
|
|||
const bool completerActive = c->completionCount() > 0;
|
||||
int count = completerActive ? _lastCompleterHighlightRow + 1 : 1;
|
||||
int idx = findXthOccurance(this, count, text);
|
||||
if (idx == -1) {
|
||||
return;
|
||||
}
|
||||
emit currentIndexChanged(idx);
|
||||
emit currentTextChanged(text);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user