Commit ccef3793 authored by Valentin Valls's avatar Valentin Valls

Add transaction when removing many items

parent cc29a6a5
......@@ -155,11 +155,12 @@ class Plot(qt.QObject):
def removeItem(self, item: Item):
items = self.__itemTree(item)
for i in items:
item._setPlot(None)
self.__items.remove(i)
for i in items:
self.itemRemoved.emit(i)
with self.transaction():
for i in items:
item._setPlot(None)
self.__items.remove(i)
for i in items:
self.itemRemoved.emit(i)
self.invalidateStructure()
def items(self) -> List[Item]:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment