aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets
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
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')
-rw-r--r--examples/widgets/draganddrop/draggabletext/draggabletext.py4
-rw-r--r--examples/widgets/tutorials/cannon/t14.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/draganddrop/draggabletext/draggabletext.py b/examples/widgets/draganddrop/draggabletext/draggabletext.py
index 480f3f4c6..a9ef72c41 100644
--- a/examples/widgets/draganddrop/draggabletext/draggabletext.py
+++ b/examples/widgets/draganddrop/draggabletext/draggabletext.py
@@ -58,7 +58,7 @@ class DragLabel(QLabel):
self.setFrameShadow(QFrame.Raised)
def mousePressEvent(self, event):
- hotSpot = event.pos()
+ hotSpot = event.position().toPoint()
mimeData = QMimeData()
mimeData.setText(self.text())
@@ -121,7 +121,7 @@ class DragWidget(QWidget):
if event.mimeData().hasText():
mime = event.mimeData()
pieces = mime.text().split()
- position = event.pos()
+ position = event.position().toPoint()
hotSpot = QPoint()
hotSpotPos = mime.data('application/x-hotspot').split(' ')
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():