From a061a646429c6e9d695458fc0ecb0021a30e12ee Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Thu, 4 Jun 2020 18:07:06 +0200 Subject: Replace calls to deprecated QEvent accessor functions Many of these were generated by clazy using the new qevent-accessors check. Change-Id: Ie17af17f50fdc9f47d7859d267c14568cc350fd0 Reviewed-by: Volker Hilsheimer --- examples/widgets/draganddrop/draggabletext/dragwidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/widgets/draganddrop/draggabletext') diff --git a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp index 4a430ebf56..1f1889c7cf 100644 --- a/examples/widgets/draganddrop/draggabletext/dragwidget.cpp +++ b/examples/widgets/draganddrop/draggabletext/dragwidget.cpp @@ -114,7 +114,7 @@ void DragWidget::dropEvent(QDropEvent *event) const QMimeData *mime = event->mimeData(); QStringList pieces = mime->text().split(QRegularExpression(QStringLiteral("\\s+")), Qt::SkipEmptyParts); - QPoint position = event->pos(); + QPoint position = event->position().toPoint(); QPoint hotSpot; QByteArrayList hotSpotPos = mime->data(hotSpotMimeDataKey()).split(' '); @@ -149,11 +149,11 @@ void DragWidget::dropEvent(QDropEvent *event) void DragWidget::mousePressEvent(QMouseEvent *event) { - QLabel *child = qobject_cast(childAt(event->pos())); + QLabel *child = qobject_cast(childAt(event->position().toPoint())); if (!child) return; - QPoint hotSpot = event->pos() - child->pos(); + QPoint hotSpot = event->position().toPoint() - child->pos(); QMimeData *mimeData = new QMimeData; mimeData->setText(child->text()); -- cgit v1.2.3