diff options
Diffstat (limited to 'src/main/python/utils/graphics.py')
-rw-r--r-- | src/main/python/utils/graphics.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main/python/utils/graphics.py b/src/main/python/utils/graphics.py index bb113ce..979841f 100644 --- a/src/main/python/utils/graphics.py +++ b/src/main/python/utils/graphics.py @@ -105,6 +105,12 @@ class CustomScene(QGraphicsScene): # (slot) used to delete all selected items, and add undo action for each of them if self.selectedItems(): for item in self.selectedItems(): + self.count = 0 + if(issubclass(item.__class__,shapes.NodeItem)): + for i in item.lineGripItems: + for j in i.lines: + self.count+=1 + self.undoStack.push(deleteCommand(j, self)) self.undoStack.push(deleteCommand(item, self)) def itemMoved(self, movedItem, lastPos): @@ -135,3 +141,9 @@ class CustomScene(QGraphicsScene): self.itemMoved(self.movingItem, self.oldPos) self.movingItem = None #clear movingitem reference return super(CustomScene, self).mouseReleaseEvent(event) + def reInsertLines(self): + currentIndex = self.undoStack.index() + index = self.count+1 + if(self.count!=0): + self.count-=1 + self.undoStack.command(currentIndex-index).undo() |