From d9c1ef4c227ce38182c8e47be2ac91bbb53c4f37 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Mon, 17 Jul 2023 21:47:29 +0200 Subject: [PATCH] Only emit signals if valid entry was found --- src/utils/filter-combo-box.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/filter-combo-box.cpp b/src/utils/filter-combo-box.cpp index efe91ecd..4871df4f 100644 --- a/src/utils/filter-combo-box.cpp +++ b/src/utils/filter-combo-box.cpp @@ -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); }