Skip to content

Commit

Permalink
do not delete previuosly selected filter items
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Mar 5, 2024
1 parent db74f40 commit b1a1e52
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/asammdf/gui/widgets/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,11 +833,10 @@ def search(self, event=None):
if entry in result:
item.setCheckState(0, QtCore.Qt.CheckState.Checked)
names.add((result[entry], dg_cntr, ch_cntr))
else:
item.setCheckState(0, QtCore.Qt.CheckState.Unchecked)

iterator += 1
ch_cntr += 1

elif view.currentText() == "Selected channels only":
iterator = QtWidgets.QTreeWidgetItemIterator(widget)

Expand Down Expand Up @@ -869,6 +868,8 @@ def search(self, event=None):
else:
items.sort(key=lambda x: x.name)
widget.addTopLevelItems(items)
for item in items:
self.filter_changed(item)

else:
iterator = QtWidgets.QTreeWidgetItemIterator(widget)
Expand All @@ -878,8 +879,6 @@ def search(self, event=None):
if item.entry in result:
item.setCheckState(0, QtCore.Qt.CheckState.Checked)
names.add((result[item.entry], *item.entry))
else:
item.setCheckState(0, QtCore.Qt.CheckState.Unchecked)

iterator += 1

Expand Down

0 comments on commit b1a1e52

Please sign in to comment.