aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets/tutorials/cannon
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-19 15:31:46 +0100
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2021-03-19 18:29:40 +0100
commit306ecd14ccba188a1c88061715456c329c1ff79c (patch)
tree2515a0f138efd129d9921c7d4b460b7f9a58d9bf /examples/widgets/tutorials/cannon
parent3777356c08258f74413187e2406679f3b0c89b07 (diff)
Port examples away from deprecated QMouseEvent::pos()
As a drive by, fix the left-over QtCharts callout example to work after 227020b118fa38ada1d8bd579593dae61f6e3881. Pick-to: 6.0 Task-number: PYSIDE-1122 Change-Id: I945b57950014e882d4efd3cb0cab47262ad108b6 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'examples/widgets/tutorials/cannon')
-rw-r--r--examples/widgets/tutorials/cannon/t14.py4
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():