diff options
author | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-11-13 14:15:53 (GMT) |
---|---|---|
committer | Jan-Arve Sæther <jan-arve.saether@nokia.com> | 2009-11-13 14:15:53 (GMT) |
commit | 2432150f9eabbaa0317eeed038eaf661f8ce507e (patch) | |
tree | e45eaa146aa68f776b7d2f12b9cdaacf37d54095 /src/gui | |
parent | 3764f6a3109266bf55aed1a18dd992e90fb85221 (diff) | |
parent | aefd76b0052cd36ed7f890dd4b91f38873bec251 (diff) | |
download | Qt-2432150f9eabbaa0317eeed038eaf661f8ce507e.zip Qt-2432150f9eabbaa0317eeed038eaf661f8ce507e.tar.gz Qt-2432150f9eabbaa0317eeed038eaf661f8ce507e.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/itemviews/qitemselectionmodel.cpp | 5 |
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 |