Beispiel #1
0
 def undo(self):
     """Create a new item and recover expression."""
     item = QListWidgetItem(self.name)
     item.expr = self.mechanism
     item.setIcon(QIcon(QPixmap(":/icons/mechanism.png")))
     self.widget.insertItem(self.row, item)
Beispiel #2
0
 def redo(self):
     """Add mechanism expression to 'expr' attribute."""
     item = QListWidgetItem(self.name)
     item.expr = self.mechanism
     item.setIcon(QIcon(QPixmap(":/icons/mechanism.png")))
     self.widget.addItem(item)