1 pièce(s) jointe(s)
comment changer l'orientation de text
Salut a tous;
comment rectifier ce code pour régler le probleme d'affichage de texte sachant que j’ai changé de direction systeme de coordonnées pour QGraphicsView
self.view.scale(1, -1)
Pièce jointe 633073
Code:
1 2 3 4 5 6 7 8
| def drawline(self):
path = QPainterPath()
path.moveTo(cx, cy)
path.lineTo(nx, ny)
dist = round(((nx - cx) ** 2 + (ny - cy) ** 2) ** 0.5)
text = ("Distance : {}".format(dist))
path.addText((cx + nx) / 2, (cy + ny) / 2, QFont('Times', 20), text)
self.path_item.setPath(path) |