summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qitemselectionmodel.cpp
diff options
context:
space:
mode:
authorWarwick Allison <warwick.allison@nokia.com>2009-11-19 03:13:15 (GMT)
committerWarwick Allison <warwick.allison@nokia.com>2009-11-19 03:13:15 (GMT)
commit398d37e78d0026b832e1676de9bd33b5441bfd9e (patch)
tree69cfa40370d5b837ac310a463f898471fa949f3a /src/gui/itemviews/qitemselectionmodel.cpp
parentbfe06c2531fa47d4d417ec22bdb184b06ad0f073 (diff)
parent80cd617b05ad3e647c87dc063d40cde0617344ca (diff)
downloadQt-398d37e78d0026b832e1676de9bd33b5441bfd9e.zip
Qt-398d37e78d0026b832e1676de9bd33b5441bfd9e.tar.gz
Qt-398d37e78d0026b832e1676de9bd33b5441bfd9e.tar.bz2
Merge branch '4.6' of git://scm.dev.nokia.troll.no/qt/qt into kinetic-declarativeui
Conflicts: src/3rdparty/webkit/WebKit/qt/WebCoreSupport/FrameLoaderClientQt.cpp
Diffstat (limited to 'src/gui/itemviews/qitemselectionmodel.cpp')
-rw-r--r--src/gui/itemviews/qitemselectionmodel.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp
index c6e02a6..2e4a602 100644
--- a/src/gui/itemviews/qitemselectionmodel.cpp
+++ b/src/gui/itemviews/qitemselectionmodel.cpp
@@ -730,13 +730,14 @@ void QItemSelectionModelPrivate::_q_layoutAboutToBeChanged()
savedPersistentIndexes.clear();
savedPersistentCurrentIndexes.clear();
- // special case for when all indexes are selected
+ // optimisation for when all indexes are selected
+ // (only if there is lots of items (1000) because this is not entirely correct)
if (ranges.isEmpty() && currentSelection.count() == 1) {
QItemSelectionRange range = currentSelection.first();
QModelIndex parent = range.parent();
tableRowCount = model->rowCount(parent);
tableColCount = model->columnCount(parent);
- if (tableRowCount * tableColCount > 100
+ if (tableRowCount * tableColCount > 1000
&& range.top() == 0
&& range.left() == 0
&& range.bottom() == tableRowCount - 1