summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-09-08 10:59:44 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-09-08 11:01:28 (GMT)
commit9d9b7f53750dce2da88d7d11d312b4b36250b5c5 (patch)
tree2dfec33fb3da2c19f0ac33d81f67ec36cf8617a5 /src
parent9a90fcca3e9a9a49cee228054017ff7d15645082 (diff)
downloadQt-9d9b7f53750dce2da88d7d11d312b4b36250b5c5.zip
Qt-9d9b7f53750dce2da88d7d11d312b4b36250b5c5.tar.gz
Qt-9d9b7f53750dce2da88d7d11d312b4b36250b5c5.tar.bz2
Fixes a regression in QListView in 4.6 regarding the selection
In icon mode, if you click on the viewport (with extended selection), the selection should be cleared when you release the mouse button. Reviewed-by: ogoffart
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 52529ff..99e9aeb 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -1661,6 +1661,10 @@ void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event)
EditTrigger trigger = (selectedClicked ? SelectedClicked : NoEditTriggers);
bool edited = edit(index, trigger, event);
+ //in the case the user presses on no item we might decide to clear the selection
+ if (d->selectionModel && !index.isValid())
+ d->selectionModel->select(QModelIndex(), selectionCommand(index, event));
+
setState(NoState);
if (click) {