(self, x, y)
setPos with adjustment for alignment
setPos with adjustment for alignment
setPos with adjustment for alignment
def setPos(self, x, y):
        """setPos with adjustment for alignment"""
        self.x, self.y = x, y
        rect = QGraphicsTextItem.boundingRect(self)
        if self.vertical:
            h, w = rect.height(), rect.width()
            rect.setWidth(h)
            rect.setHeight(-w)
        if int(self.alignment & Qt.AlignRight):
            x -= rect.width()
        elif int(self.alignment & Qt.AlignHCenter):
            x -= rect.width() / 2.
        if int(self.alignment & Qt.AlignBottom):
            y -= rect.height()
        elif int(self.alignment & Qt.AlignVCenter):
            y -= rect.height() / 2.
        QGraphicsTextItem.setPos(self, x, y)
def setPos ( self , x , y ) : self . x , self . y = x , y rect = QGraphicsTextItem . boundingRect ( self ) if self . vertical : h , w = rect . height ( ) , rect . width ( ) rect . setWidth ( h ) rect . setHeight ( - w ) if int ( self . alignment & Qt . AlignRight ) : x -= rect . width ( ) elif int ( self . alignment & Qt . AlignHCenter ) : x -= rect . width ( ) / 2. if int ( self . alignment & Qt . AlignBottom ) : y -= rect . height ( ) elif int ( self . alignment & Qt . AlignVCenter ) : y -= rect . height ( ) / 2. QGraphicsTextItem . setPos ( self , x , y )