Skip to content

Commit 7ddea12

Browse files
authored
Merge pull request #476 from timothyliu3d/PySide6
fix: PySide6 errors when using slicer.
2 parents 2596720 + 049ca66 commit 7ddea12

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

NodeGraphQt/qgraphics/slicer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ def paint(self, painter, option, widget):
3333
arrow_size = 4.0
3434

3535
painter.save()
36-
painter.setRenderHint(painter.Antialiasing, True)
36+
painter.setRenderHint(QtGui.QPainter.Antialiasing, True)
3737

3838
font = painter.font()
3939
font.setPointSize(12)
4040
painter.setFont(font)
4141
text = 'slice'
42-
text_x = painter.fontMetrics().width(text) / 2
42+
text_x = painter.fontMetrics().horizontalAdvance(text) / 2
4343
text_y = painter.fontMetrics().height() / 1.5
4444
text_pos = QtCore.QPointF(p1.x() - text_x, p1.y() - text_y)
4545
text_color = QtGui.QColor(*PipeSlicerEnum.COLOR.value)

0 commit comments

Comments
 (0)