improve performance for show/hide graphs
This commit is contained in:
@ -385,12 +385,16 @@ class UpperManagement(QtCore.QObject):
|
||||
|
||||
def change_visibility(self, selected: list, deselected: list):
|
||||
"""Change status of list of ids after status change in datawidget"""
|
||||
for item_list, func in [(selected, 'show_item'), (deselected, 'hide_item')]:
|
||||
grouping = {}
|
||||
for s in item_list:
|
||||
g = self.data[s].graph
|
||||
if g not in grouping:
|
||||
grouping[g] = []
|
||||
grouping[g].append(s)
|
||||
|
||||
for s in selected:
|
||||
self.graphs[self.data[s].graph].show_item([s])
|
||||
|
||||
for d in deselected:
|
||||
self.graphs[self.data[d].graph].hide_item([d])
|
||||
for k, v in grouping.items():
|
||||
getattr(self.graphs[k], func)(v)
|
||||
|
||||
@QtCore.pyqtSlot(str, str)
|
||||
def change_keys(self, identifier: str, name: str):
|
||||
|
Reference in New Issue
Block a user