diff --git a/plotpy/items/shape/polygon.py b/plotpy/items/shape/polygon.py index 207c278..a739a91 100644 --- a/plotpy/items/shape/polygon.py +++ b/plotpy/items/shape/polygon.py @@ -276,8 +276,10 @@ def draw( painter.setBrush(brush) points = self.transform_points(xMap, yMap) if self.ADDITIONNAL_POINTS: - shape_points = points[: -self.ADDITIONNAL_POINTS] - other_points = points[-self.ADDITIONNAL_POINTS :] + # Slice indexing is not supported by PySide6, so we convert the `QPolygonF` + # object to a list before converting it back to a `QPolygonF` object: + shape_points = QG.QPolygonF(list(points[: -self.ADDITIONNAL_POINTS])) + other_points = QG.QPolygonF(list(points[-self.ADDITIONNAL_POINTS :])) else: shape_points = points other_points = []