diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2009-12-05 11:23:36 (GMT) |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2009-12-05 11:23:36 (GMT) |
commit | 9093d6c498f1b70c7ec58fc52bb9d5f0a4302540 (patch) | |
tree | 5bb0e87be487d80c76a16c23ee94e7f97fcc95c6 /src/gui/itemviews/qabstractitemview.cpp | |
parent | cbdf3dc7508131e31f1d221e7b6f44d4714d3caa (diff) | |
parent | 291a26abae4b7e1e4b77baf42964ccb77edf4adf (diff) | |
download | Qt-9093d6c498f1b70c7ec58fc52bb9d5f0a4302540.zip Qt-9093d6c498f1b70c7ec58fc52bb9d5f0a4302540.tar.gz Qt-9093d6c498f1b70c7ec58fc52bb9d5f0a4302540.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index acfeff8..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); |