QHeaderView: fix calculating dragPosition

The dragPosition was calculated without taking the scroll offset into
account as it's done within QAIV.
Amends 787b4c1506aba7e83d861e178329a18c6ec34322

Pick-to: 6.5
Fixes: QTBUG-120055
Task-number: QTBUG-113573
Change-Id: I0e20065f797a1a3f7df07583fccfa029b636fead
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 64a283a98894705fe51c9423812bbeb634138850)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 36f01b7f56fe3421c890600bc10103f6904754a5)
This commit is contained in:
Christian Ehrlicher 2023-12-15 20:42:33 +01:00 committed by Qt Cherry-pick Bot
parent b492b6da6f
commit 4883d2f591

View File

@ -2610,7 +2610,7 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
}
case QHeaderViewPrivate::MoveSection: {
if (d->shouldAutoScroll(e->position().toPoint())) {
d->draggedPosition = e->pos();
d->draggedPosition = e->pos() + d->offset();
d->startAutoScroll();
}
if (qAbs(pos - d->firstPos) >= QApplication::startDragDistance()