summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@nokia.com>2009-12-08 09:10:52 (GMT)
committerMorten Johan Sørvig <morten.sorvig@nokia.com>2009-12-08 09:10:52 (GMT)
commit3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54 (patch)
treebdd95d791244c6cc72a19a48118ab72ff5edcfb2 /src/gui/itemviews/qabstractitemview.cpp
parent55be2d1d684d4505db3bbf76da0cf8326cee9468 (diff)
parentdfbdb86fd4614be9be17cbfb602ed5a3b5a38671 (diff)
downloadQt-3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54.zip
Qt-3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54.tar.gz
Qt-3f5e4ed4d2b110f4c6e952b74c9f852a2dc14a54.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index ad15655..de6e6cb 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1625,7 +1625,7 @@ void QAbstractItemView::mousePressEvent(QMouseEvent *event)
QPoint offset = d->offset();
if ((command & QItemSelectionModel::Current) == 0)
d->pressedPosition = pos + offset;
- else if (!indexAt(d->pressedPosition).isValid())
+ else if (!indexAt(d->pressedPosition - offset).isValid())
d->pressedPosition = visualRect(currentIndex()).center() + offset;
if (edit(index, NoEditTriggers, event))
@@ -2195,7 +2195,7 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event)
// note that we don't check if the new current index is enabled because moveCursor() makes sure it is
if (command & QItemSelectionModel::Current) {
d->selectionModel->setCurrentIndex(newCurrent, QItemSelectionModel::NoUpdate);
- if (!indexAt(d->pressedPosition).isValid())
+ if (!indexAt(d->pressedPosition - d->offset()).isValid())
d->pressedPosition = visualRect(oldCurrent).center() + d->offset();
QRect rect(d->pressedPosition - d->offset(), visualRect(newCurrent).center());
setSelection(rect, command);
@@ -2552,7 +2552,9 @@ void QAbstractItemView::verticalScrollbarValueChanged(int value)
Q_D(QAbstractItemView);
if (verticalScrollBar()->maximum() == value && d->model->canFetchMore(d->root))
d->model->fetchMore(d->root);
- d->checkMouseMove(viewport()->mapFromGlobal(QCursor::pos()));
+ QPoint posInVp = viewport()->mapFromGlobal(QCursor::pos());
+ if (viewport()->rect().contains(posInVp))
+ d->checkMouseMove(posInVp);
}
/*!
@@ -2563,7 +2565,9 @@ void QAbstractItemView::horizontalScrollbarValueChanged(int value)
Q_D(QAbstractItemView);
if (horizontalScrollBar()->maximum() == value && d->model->canFetchMore(d->root))
d->model->fetchMore(d->root);
- d->checkMouseMove(viewport()->mapFromGlobal(QCursor::pos()));
+ QPoint posInVp = viewport()->mapFromGlobal(QCursor::pos());
+ if (viewport()->rect().contains(posInVp))
+ d->checkMouseMove(posInVp);
}
/*!