Skip to content

Commit

Permalink
Search: don't update empty combobox when removing list items
Browse files Browse the repository at this point in the history
  • Loading branch information
ronso0 committed Oct 20, 2021
1 parent c5be3f3 commit a93b621
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/widget/wsearchlineedit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,9 +534,16 @@ void WSearchLineEdit::deleteSelectedComboboxItem() {
}

void WSearchLineEdit::deleteSelectedListItem() {
bool wasEmpty = currentIndex() == -1 ? true : false;
QComboBox::removeItem(view()->currentIndex().row());
// ToDo Resize the list to new item size
// Close the popup if all items were removed

// When an item is removed the combobox would pick a sibling and trigger a
// search. Avoid this if the box was empty when the popup was opened.
if (wasEmpty) {
QComboBox::setCurrentIndex(-1);
}
if (count() == 0) {
hidePopup();
}
Expand Down

0 comments on commit a93b621

Please sign in to comment.