summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorThorbjørn Lund Martsum <tmartsum@gmail.com>2012-11-02 17:25:42 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-11-03 11:20:30 (GMT)
commit7080cc765c9566e852797dbaf60fe50a2fcc2b72 (patch)
tree099a4eeb4c7c0ad76765105609444d2c772b5801 /src/gui/itemviews
parent9b055a679d20f912d7c99bc239c02c253a10c6a0 (diff)
downloadQt-7080cc765c9566e852797dbaf60fe50a2fcc2b72.zip
Qt-7080cc765c9566e852797dbaf60fe50a2fcc2b72.tar.gz
Qt-7080cc765c9566e852797dbaf60fe50a2fcc2b72.tar.bz2
Qt 4 - QHeaderView - 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 is a backport of SHA d625535728154fc9ca576bf6472c6b5057a96f17 This solves e.g. Task-number: QTBUG-14814 Change-Id: I8e2c820dc9018fb3d14b71f28aa317417c997a44 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qheaderview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp
index 65a8858..2bc4619 100644
--- a/src/gui/itemviews/qheaderview.cpp
+++ b/src/gui/itemviews/qheaderview.cpp
@@ -2243,7 +2243,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)