summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-02-23 17:24:14 (GMT)
committerGabriel de Dietrich <gabriel.dietrich-de@nokia.com>2010-02-24 10:51:37 (GMT)
commite573588ed941a9d270b5c0644cb4150f7ef05b6a (patch)
treec962b0011be54130ad198f14c5a9a36edc8a868e /src/gui/itemviews
parentfaafe532ffdfc375c0897249f05ff32b6dfc0066 (diff)
downloadQt-e573588ed941a9d270b5c0644cb4150f7ef05b6a.zip
Qt-e573588ed941a9d270b5c0644cb4150f7ef05b6a.tar.gz
Qt-e573588ed941a9d270b5c0644cb4150f7ef05b6a.tar.bz2
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
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qheaderview.cpp9
1 files 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;
}