From: Thorbjørn Lund Martsum Date: Thu, 1 Nov 2012 15:33:25 +0000 (+0100) Subject: QHeaderView 5.0 - correct drop on manual QHeaderView sectionmove X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d625535728154fc9ca576bf6472c6b5057a96f17;p=profile%2Fivi%2Fqtbase.git QHeaderView 5.0 - correct drop on manual QHeaderView sectionmove This fixes an error in the calculation of the exact drop position when an user is moving a section in QHeaderView. Before we compared a mouse-position local to the widget (pos) with a summed length of sections (posThreshold). However we need to consider/substract the headers offset to make the posThreshold comparable to the local mouse position. This solves e.g. Task-number: QTBUG-14814 Change-Id: If0281cf0c7b98316474f18e8eaa32c6d062dda56 Reviewed-by: Stephen Kelly --- diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp index c6b95af..541d40d 100644 --- a/src/widgets/itemviews/qheaderview.cpp +++ b/src/widgets/itemviews/qheaderview.cpp @@ -2332,7 +2332,7 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e) int visual = visualIndexAt(pos); if (visual == -1) return; - int posThreshold = d->headerSectionPosition(visual) + d->headerSectionSize(visual) / 2; + int posThreshold = d->headerSectionPosition(visual) - d->offset + d->headerSectionSize(visual) / 2; int moving = visualIndex(d->section); if (visual < moving) { if (pos < posThreshold)