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 75711d0 commit 45c0a1d
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 @@ -529,9 +529,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

// If the combobox was empty when the popup was opened, and an item is removed
// a sibling
if (wasEmpty) {
QComboBox::setCurrentIndex(-1);
}
if (count() == 0) {
hidePopup();
}
Expand Down

0 comments on commit 45c0a1d

Please sign in to comment.