aboutsummaryrefslogtreecommitdiffstats
path: root/examples/widgets
diff options
context:
space:
mode:
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():