def flipLabel(self): w = self.label.boundingRect().width() if self.flip: self.label.setTransform( QTransform.fromScale(-1, 1).translate(-w, 0)) else: self.label.setTransform(QTransform.fromScale(1, 1))
def setFlip(self, flip=None): if flip: self.flip = flip if self.flip: self.setTransform(QTransform.fromScale(-1, 1)) else: self.setTransform(QTransform.fromScale(1, 1)) self.flipLabel()
def setFlip(self, flip=None): if flip: self.flip = flip if self.flip: self.setTransform(QTransform.fromScale(-1, 1)) else: self.setTransform(QTransform.fromScale(1, 1)) for p in self.ports(): p.setFlip() #self.setIcon() self.flipLabel()
def mousePressEvent(self, event): x = event.scenePos().x() y = event.scenePos().y() t = QTransform() self.actComp = self.itemAt(x, y, t)
def setFlip(self): isflipped = self.parent.flip if isflipped: self.setTransform(QTransform.fromScale(-1, 1)) else: self.setTransform(QTransform.fromScale(1, 1))