示例#1
0
 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))
示例#2
0
 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()
示例#3
0
 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()
示例#4
0
    def mousePressEvent(self, event):
        x = event.scenePos().x()
        y = event.scenePos().y()

        t = QTransform()
        self.actComp = self.itemAt(x, y, t)
示例#5
0
 def setFlip(self):
     isflipped = self.parent.flip
     if isflipped:
         self.setTransform(QTransform.fromScale(-1, 1))
     else:
         self.setTransform(QTransform.fromScale(1, 1))