예제 #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)
예제 #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)
예제 #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)