From e573588ed941a9d270b5c0644cb4150f7ef05b6a Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Tue, 23 Feb 2010 18:24:14 +0100 Subject: Fixed hypersensitive drag on QHeaderViews The header section was in a moving state before the drag actually started. That is, before we moved more than QApplication::startDragDistance(). This could cause a click to be considered as a move in some cases. No auto-test as it would involve dragging. Task-number: QTBUG-7327 Reviewed-by: Olivier --- src/gui/itemviews/qheaderview.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index 1c26e51..5128b64 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -2221,7 +2221,8 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e) return; } case QHeaderViewPrivate::MoveSection: { - if (qAbs(pos - d->firstPos) >= QApplication::startDragDistance()) { + if (qAbs(pos - d->firstPos) >= QApplication::startDragDistance() + || !d->sectionIndicator->isHidden()) { int indicatorCenter = (d->orientation == Qt::Horizontal ? d->sectionIndicator->width() : d->sectionIndicator->height()) / 2; @@ -2233,12 +2234,6 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e) return; d->target = d->logicalIndex(visual); d->updateSectionIndicator(d->section, pos); - } else { - int visual = visualIndexAt(d->firstPos); - if (visual == -1) - return; - d->target = d->logicalIndex(visual); - d->updateSectionIndicator(d->section, d->firstPos); } return; } -- cgit v0.12