Ejemplo n.º 1
0
 def __init__(self, canvas):
     QUndoCommand.__init__(self, self.TEXT)
     self.canvas_ref = weakref.ref(canvas)
     self.before_image = i = canvas.current_image
     if i is None:
         raise ValueError('No image loaded')
     if i.isNull():
         raise ValueError('Cannot perform operations on invalid images')
     self.after_image = self(canvas)
Ejemplo n.º 2
0
 def __init__(self, canvas):
     QUndoCommand.__init__(self, self.TEXT)
     self.canvas_ref = weakref.ref(canvas)
     self.before_image = i = canvas.current_image
     if i is None:
         raise ValueError('No image loaded')
     if i.isNull():
         raise ValueError('Cannot perform operations on invalid images')
     self.after_image = self(canvas)
Ejemplo n.º 3
0
    def __init__(self, widget, val):
        QUndoCommand.__init__(self)
        self.widget = weakref.ref(widget)
        self.undo_val = widget.rating_value
        self.redo_val = val

        def undo(self):
            w = self.widget()
            w.setCurrentIndex(self.undo_val)

        def redo(self):
            w = self.widget()
            w.setCurrentIndex(self.redo_val)
Ejemplo n.º 4
0
    def __init__(self, widget, val):
        QUndoCommand.__init__(self)
        self.widget = weakref.ref(widget)
        self.undo_val = widget.rating_value
        self.redo_val = val

        def undo(self):
            w = self.widget()
            w.setCurrentIndex(self.undo_val)

        def redo(self):
            w = self.widget()
            w.setCurrentIndex(self.redo_val)