Ejemplo n.º 1
0
    def setProperty(self, key, value, use_undostack=True):
        """ Get the value of the key model properties

        Args:
            key (str):
            value (object):
            use_undostack (bool, optional): default True
        """
        if key == 'is_visible':
            self._document.clearAllSelected()
        if use_undostack:
            c = SetPropertyCommand([self], key, value)
            self.undoStack().push(c)
        else:
            self._setProperty(key, value)
Ejemplo n.º 2
0
    def setProperty(self, key: str, value: Any, use_undostack: bool = True):
        """ Get the value of the key model properties

        Args:
            key:
            value:
            use_undostack: default is ``True``
        """
        if key == 'is_visible':
            self._document.clearAllSelected()
        if use_undostack:
            c = SetPropertyCommand([self], key, value)
            self.undoStack().push(c)
        else:
            self._setProperty(key, value)
Ejemplo n.º 3
0
 def setProperty(self, key, value, use_undostack=True):
     if use_undostack:
         c = SetPropertyCommand([self], key, value)
         self.undoStack().push(c)
     else:
         self._setProperty(key, value)