diff options
Diffstat (limited to 'examples/widgets/tutorials/cannon/t14.py')
-rw-r--r-- | examples/widgets/tutorials/cannon/t14.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/widgets/tutorials/cannon/t14.py b/examples/widgets/tutorials/cannon/t14.py index d558d2e61..19fb95ac8 100644 --- a/examples/widgets/tutorials/cannon/t14.py +++ b/examples/widgets/tutorials/cannon/t14.py @@ -217,13 +217,13 @@ class CannonField(QtWidgets.QWidget): def mousePressEvent(self, event): if event.button() != QtCore.Qt.LeftButton: return - if self.barrelHit(event.pos()): + if self.barrelHit(event.position().toPoint()): self.barrelPressed = True def mouseMoveEvent(self, event): if not self.barrelPressed: return - pos = event.pos() + pos = event.position().toPoint() if pos.x() <= 0: pos.setX(1) if pos.y() >= self.height(): |