diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-04 18:07:06 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-06-08 19:11:51 +0200 |
commit | a061a646429c6e9d695458fc0ecb0021a30e12ee (patch) | |
tree | 7ba6fce7ee7c8975b0c50e31195bd02c5419fc15 /examples/widgets/draganddrop/draggableicons/dragwidget.cpp | |
parent | 24e52c10deedbaef833c0e2c3ee7bee03eacc4f5 (diff) |
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 <volker.hilsheimer@qt.io>
Diffstat (limited to 'examples/widgets/draganddrop/draggableicons/dragwidget.cpp')
-rw-r--r-- | examples/widgets/draganddrop/draggableicons/dragwidget.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/widgets/draganddrop/draggableicons/dragwidget.cpp b/examples/widgets/draganddrop/draggableicons/dragwidget.cpp index 00671dcf7e..1b3774db4f 100644 --- a/examples/widgets/draganddrop/draggableicons/dragwidget.cpp +++ b/examples/widgets/draganddrop/draggableicons/dragwidget.cpp @@ -120,7 +120,7 @@ void DragWidget::dropEvent(QDropEvent *event) QLabel *newIcon = new QLabel(this); newIcon->setPixmap(pixmap); - newIcon->move(event->pos() - offset); + newIcon->move(event->position().toPoint() - offset); newIcon->show(); newIcon->setAttribute(Qt::WA_DeleteOnClose); @@ -138,7 +138,7 @@ void DragWidget::dropEvent(QDropEvent *event) //! [1] void DragWidget::mousePressEvent(QMouseEvent *event) { - QLabel *child = static_cast<QLabel*>(childAt(event->pos())); + QLabel *child = static_cast<QLabel*>(childAt(event->position().toPoint())); if (!child) return; @@ -146,7 +146,7 @@ void DragWidget::mousePressEvent(QMouseEvent *event) QByteArray itemData; QDataStream dataStream(&itemData, QIODevice::WriteOnly); - dataStream << pixmap << QPoint(event->pos() - child->pos()); + dataStream << pixmap << QPoint(event->position().toPoint() - child->pos()); //! [1] //! [2] @@ -158,7 +158,7 @@ void DragWidget::mousePressEvent(QMouseEvent *event) QDrag *drag = new QDrag(this); drag->setMimeData(mimeData); drag->setPixmap(pixmap); - drag->setHotSpot(event->pos() - child->pos()); + drag->setHotSpot(event->position().toPoint() - child->pos()); //! [3] QPixmap tempPixmap = pixmap; |