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 /src/widgets/itemviews/qheaderview.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 'src/widgets/itemviews/qheaderview.cpp')
-rw-r--r-- | src/widgets/itemviews/qheaderview.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index fce0834628..e127f7bba4 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2371,7 +2371,7 @@ bool QHeaderView::event(QEvent *e) switch (e->type()) { case QEvent::HoverEnter: { QHoverEvent *he = static_cast<QHoverEvent*>(e); - d->hover = logicalIndexAt(he->pos()); + d->hover = logicalIndexAt(he->position().toPoint()); if (d->hover != -1) updateSection(d->hover); break; } @@ -2384,7 +2384,7 @@ bool QHeaderView::event(QEvent *e) case QEvent::HoverMove: { QHoverEvent *he = static_cast<QHoverEvent*>(e); int oldHover = d->hover; - d->hover = logicalIndexAt(he->pos()); + d->hover = logicalIndexAt(he->position().toPoint()); if (d->hover != oldHover) { if (oldHover != -1) updateSection(oldHover); @@ -2524,7 +2524,7 @@ void QHeaderView::mousePressEvent(QMouseEvent *e) Q_D(QHeaderView); if (d->state != QHeaderViewPrivate::NoState || e->button() != Qt::LeftButton) return; - int pos = d->orientation == Qt::Horizontal ? e->x() : e->y(); + int pos = d->orientation == Qt::Horizontal ? e->position().toPoint().x() : e->position().toPoint().y(); int handle = d->sectionHandleAt(pos); d->originalSize = -1; // clear the stored original size if (handle == -1) { @@ -2566,7 +2566,7 @@ void QHeaderView::mousePressEvent(QMouseEvent *e) void QHeaderView::mouseMoveEvent(QMouseEvent *e) { Q_D(QHeaderView); - int pos = d->orientation == Qt::Horizontal ? e->x() : e->y(); + int pos = d->orientation == Qt::Horizontal ? e->position().toPoint().x() : e->position().toPoint().y(); if (pos < 0 && d->state != QHeaderViewPrivate::SelectSections) return; if (e->buttons() == Qt::NoButton) { @@ -2594,7 +2594,7 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e) return; } case QHeaderViewPrivate::MoveSection: { - if (d->shouldAutoScroll(e->pos())) + if (d->shouldAutoScroll(e->position().toPoint())) d->startAutoScroll(); if (qAbs(pos - d->firstPos) >= QApplication::startDragDistance() #if QT_CONFIG(label) @@ -2678,7 +2678,7 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e) void QHeaderView::mouseReleaseEvent(QMouseEvent *e) { Q_D(QHeaderView); - int pos = d->orientation == Qt::Horizontal ? e->x() : e->y(); + int pos = d->orientation == Qt::Horizontal ? e->position().toPoint().x() : e->position().toPoint().y(); switch (d->state) { case QHeaderViewPrivate::MoveSection: if (true @@ -2731,7 +2731,7 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e) void QHeaderView::mouseDoubleClickEvent(QMouseEvent *e) { Q_D(QHeaderView); - int pos = d->orientation == Qt::Horizontal ? e->x() : e->y(); + int pos = d->orientation == Qt::Horizontal ? e->position().toPoint().x() : e->position().toPoint().y(); int handle = d->sectionHandleAt(pos); if (handle > -1 && sectionResizeMode(handle) == Interactive) { emit sectionHandleDoubleClicked(handle); @@ -2746,7 +2746,7 @@ void QHeaderView::mouseDoubleClickEvent(QMouseEvent *e) } #endif } else { - emit sectionDoubleClicked(logicalIndexAt(e->pos())); + emit sectionDoubleClicked(logicalIndexAt(e->position().toPoint())); } } |