diff options
Diffstat (limited to 'examples/widgets/tutorials')
| -rw-r--r-- | examples/widgets/tutorials/cannon/t10.py | 2 | ||||
| -rw-r--r-- | examples/widgets/tutorials/cannon/t11.py | 2 | ||||
| -rw-r--r-- | examples/widgets/tutorials/cannon/t12.py | 2 | ||||
| -rw-r--r-- | examples/widgets/tutorials/cannon/t13.py | 2 | ||||
| -rw-r--r-- | examples/widgets/tutorials/cannon/t14.py | 2 | ||||
| -rw-r--r-- | examples/widgets/tutorials/cannon/t8.py | 2 | ||||
| -rw-r--r-- | examples/widgets/tutorials/cannon/t9.py | 2 |
7 files changed, 14 insertions, 0 deletions
diff --git a/examples/widgets/tutorials/cannon/t10.py b/examples/widgets/tutorials/cannon/t10.py index ed3d9fce3..98b5f57fe 100644 --- a/examples/widgets/tutorials/cannon/t10.py +++ b/examples/widgets/tutorials/cannon/t10.py @@ -138,6 +138,8 @@ class CannonField(QWidget): painter.drawPie(QRect(-35, -35, 70, 70), 0, 90 * 16) painter.rotate(-self._current_angle) painter.drawRect(QRect(33, -4, 15, 8)) + # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3. + painter.end() def cannon_rect(self): result = QRect(0, 0, 50, 50) diff --git a/examples/widgets/tutorials/cannon/t11.py b/examples/widgets/tutorials/cannon/t11.py index f297a14b4..ea8e53a8e 100644 --- a/examples/widgets/tutorials/cannon/t11.py +++ b/examples/widgets/tutorials/cannon/t11.py @@ -164,6 +164,8 @@ class CannonField(QWidget): self.paint_cannon(painter) if self._auto_shoot_timer.isActive(): self.paint_shot(painter) + # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3. + painter.end() def paint_shot(self, painter): painter.setPen(Qt.NoPen) diff --git a/examples/widgets/tutorials/cannon/t12.py b/examples/widgets/tutorials/cannon/t12.py index f2c6ea08c..98b2ff248 100644 --- a/examples/widgets/tutorials/cannon/t12.py +++ b/examples/widgets/tutorials/cannon/t12.py @@ -205,6 +205,8 @@ class CannonField(QWidget): self.paint_shot(painter) self.paint_target(painter) + # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3. + painter.end() def paint_shot(self, painter): painter.setPen(Qt.NoPen) diff --git a/examples/widgets/tutorials/cannon/t13.py b/examples/widgets/tutorials/cannon/t13.py index aa00825aa..3ac05f435 100644 --- a/examples/widgets/tutorials/cannon/t13.py +++ b/examples/widgets/tutorials/cannon/t13.py @@ -232,6 +232,8 @@ class CannonField(QWidget): self.paint_shot(painter) if not self._game_ended: self.paint_target(painter) + # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3. + painter.end() def paint_shot(self, painter): painter.setPen(Qt.NoPen) diff --git a/examples/widgets/tutorials/cannon/t14.py b/examples/widgets/tutorials/cannon/t14.py index 0e8318ebe..8a3fe98e8 100644 --- a/examples/widgets/tutorials/cannon/t14.py +++ b/examples/widgets/tutorials/cannon/t14.py @@ -256,6 +256,8 @@ class CannonField(QWidget): self.paint_shot(painter) if not self._game_ended: self.paint_target(painter) + # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3. + painter.end() def paint_shot(self, painter): painter.setPen(Qt.NoPen) diff --git a/examples/widgets/tutorials/cannon/t8.py b/examples/widgets/tutorials/cannon/t8.py index cc54194cf..b02a049cc 100644 --- a/examples/widgets/tutorials/cannon/t8.py +++ b/examples/widgets/tutorials/cannon/t8.py @@ -117,6 +117,8 @@ class CannonField(QWidget): def paintEvent(self, event): painter = QPainter(self) painter.drawText(200, 200, f"Angle = {self._current_angle}") + # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3. + painter.end() class MyWidget(QWidget): diff --git a/examples/widgets/tutorials/cannon/t9.py b/examples/widgets/tutorials/cannon/t9.py index 36dcf8fb1..f18144310 100644 --- a/examples/widgets/tutorials/cannon/t9.py +++ b/examples/widgets/tutorials/cannon/t9.py @@ -124,6 +124,8 @@ class CannonField(QWidget): painter.drawPie(QRect(-35, -35, 70, 70), 0, 90 * 16) painter.rotate(-self._current_angle) painter.drawRect(QRect(33, -4, 15, 8)) + # QPainter needs an explicit end() in PyPy. This will become a context manager in 6.3. + painter.end() class MyWidget(QWidget): |
