diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-08-19 00:29:51 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2010-08-19 00:29:51 (GMT) |
commit | e5893ababec6c58207c8066908e21bff3d746356 (patch) | |
tree | b4800e3a1fd5fa209b39e2f2d627081ed72bed38 /src/gui/itemviews | |
parent | 2abbc5fc400dfa8ad26397cc39f49f9b3a4304c9 (diff) | |
parent | ceb068261e326f38b4049becd75c7160a6b84f87 (diff) | |
download | Qt-e5893ababec6c58207c8066908e21bff3d746356.zip Qt-e5893ababec6c58207c8066908e21bff3d746356.tar.gz Qt-e5893ababec6c58207c8066908e21bff3d746356.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 97499f3..4ffd284 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -2270,9 +2270,11 @@ void QAbstractItemView::keyPressEvent(QKeyEvent *event) } else { d->selectionModel->setCurrentIndex(newCurrent, command); d->pressedPosition = visualRect(newCurrent).center() + d->offset(); - // We copy the same behaviour as for mousePressEvent(). - QRect rect(d->pressedPosition - d->offset(), QSize(1, 1)); - setSelection(rect, command); + if (newCurrent.isValid()) { + // We copy the same behaviour as for mousePressEvent(). + QRect rect(d->pressedPosition - d->offset(), QSize(1, 1)); + setSelection(rect, command); + } } event->accept(); return; |