Ejemplo n.º 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)
Ejemplo n.º 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)