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 --- src/widgets/dialogs/qcolordialog.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/widgets/dialogs') diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp index 3337cf328a..a605c35b05 100644 --- a/src/widgets/dialogs/qcolordialog.cpp +++ b/src/widgets/dialogs/qcolordialog.cpp @@ -382,7 +382,7 @@ void QWellArray::paintCellContents(QPainter *p, int row, int col, const QRect &r void QWellArray::mousePressEvent(QMouseEvent *e) { // The current cell marker is set to the cell the mouse is pressed in - QPoint pos = e->pos(); + QPoint pos = e->position().toPoint(); setCurrent(rowAt(pos.y()), columnAt(pos.x())); } @@ -626,7 +626,7 @@ void QColorWell::mousePressEvent(QMouseEvent *e) oldCurrent = QPoint(selectedRow(), selectedColumn()); QWellArray::mousePressEvent(e); mousePressed = true; - pressPos = e->pos(); + pressPos = e->position().toPoint(); } void QColorWell::mouseMoveEvent(QMouseEvent *e) @@ -635,7 +635,7 @@ void QColorWell::mouseMoveEvent(QMouseEvent *e) #if QT_CONFIG(draganddrop) if (!mousePressed) return; - if ((pressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { + if ((pressPos - e->position().toPoint()).manhattanLength() > QApplication::startDragDistance()) { setCurrent(oldCurrent.x(), oldCurrent.y()); int i = rowAt(pressPos.y()) + columnAt(pressPos.x()) * numRows(); QColor col(values[i]); @@ -673,7 +673,7 @@ void QColorWell::dragLeaveEvent(QDragLeaveEvent *) void QColorWell::dragMoveEvent(QDragMoveEvent *e) { if (qvariant_cast(e->mimeData()->colorData()).isValid()) { - setCurrent(rowAt(e->pos().y()), columnAt(e->pos().x())); + setCurrent(rowAt(e->position().toPoint().y()), columnAt(e->position().toPoint().x())); e->accept(); } else { e->ignore(); @@ -684,7 +684,7 @@ void QColorWell::dropEvent(QDropEvent *e) { QColor col = qvariant_cast(e->mimeData()->colorData()); if (col.isValid()) { - int i = rowAt(e->pos().y()) + columnAt(e->pos().x()) * numRows(); + int i = rowAt(e->position().toPoint().y()) + columnAt(e->position().toPoint().x()) * numRows(); emit colorChanged(i, col.rgb()); e->accept(); } else { @@ -799,11 +799,11 @@ QColorLuminancePicker::~QColorLuminancePicker() void QColorLuminancePicker::mouseMoveEvent(QMouseEvent *m) { - setVal(y2val(m->y())); + setVal(y2val(m->position().toPoint().y())); } void QColorLuminancePicker::mousePressEvent(QMouseEvent *m) { - setVal(y2val(m->y())); + setVal(y2val(m->position().toPoint().y())); } void QColorLuminancePicker::setVal(int v) @@ -932,14 +932,14 @@ void QColorPicker::setCol(int h, int s) void QColorPicker::mouseMoveEvent(QMouseEvent *m) { - QPoint p = m->pos() - contentsRect().topLeft(); + QPoint p = m->position().toPoint() - contentsRect().topLeft(); setCol(p); emit newCol(hue, sat); } void QColorPicker::mousePressEvent(QMouseEvent *m) { - QPoint p = m->pos() - contentsRect().topLeft(); + QPoint p = m->position().toPoint() - contentsRect().topLeft(); setCol(p); emit newCol(hue, sat); } @@ -1113,7 +1113,7 @@ inline bool QColorShower::isAlphaVisible() const void QColorShowLabel::mousePressEvent(QMouseEvent *e) { mousePressed = true; - pressPos = e->pos(); + pressPos = e->position().toPoint(); } void QColorShowLabel::mouseMoveEvent(QMouseEvent *e) @@ -1123,7 +1123,7 @@ void QColorShowLabel::mouseMoveEvent(QMouseEvent *e) #else if (!mousePressed) return; - if ((pressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { + if ((pressPos - e->position().toPoint()).manhattanLength() > QApplication::startDragDistance()) { QMimeData *mime = new QMimeData; mime->setColorData(col); QPixmap pix(30, 20); @@ -2219,15 +2219,15 @@ void QColorDialogPrivate::updateColorPicking(const QPoint &globalPos) bool QColorDialogPrivate::handleColorPickingMouseMove(QMouseEvent *e) { // If the cross is visible the grabbed color will be black most of the times - cp->setCrossVisible(!cp->geometry().contains(e->pos())); + cp->setCrossVisible(!cp->geometry().contains(e->position().toPoint())); - updateColorPicking(e->globalPos()); + updateColorPicking(e->globalPosition().toPoint()); return true; } bool QColorDialogPrivate::handleColorPickingMouseButtonRelease(QMouseEvent *e) { - setCurrentColor(grabScreenColor(e->globalPos()), SetColorAll); + setCurrentColor(grabScreenColor(e->globalPosition().toPoint()), SetColorAll); releaseColorPicking(); return true; } -- cgit v1.2.3