summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-08-25 10:42:43 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-08-25 10:44:24 (GMT)
commit8a7700ffb5e4959e788861e4862ebc1a7a3ad3b1 (patch)
tree0bd86802c74a38c10dd51d2dde4d8b880c434c07 /src
parent2aeeda9b82440dbcb3564c185003288b83f49683 (diff)
downloadQt-8a7700ffb5e4959e788861e4862ebc1a7a3ad3b1.zip
Qt-8a7700ffb5e4959e788861e4862ebc1a7a3ad3b1.tar.gz
Qt-8a7700ffb5e4959e788861e4862ebc1a7a3ad3b1.tar.bz2
ItemViews: selection not well kept when new rows appear
Task-number: 260134 Reviewed-by: ogoffart
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qitemselectionmodel.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp
index 8414460..8eb9e21 100644
--- a/src/gui/itemviews/qitemselectionmodel.cpp
+++ b/src/gui/itemviews/qitemselectionmodel.cpp
@@ -734,14 +734,15 @@ void QItemSelectionModelPrivate::_q_layoutAboutToBeChanged()
if (ranges.isEmpty() && currentSelection.count() == 1) {
QItemSelectionRange range = currentSelection.first();
QModelIndex parent = range.parent();
- if (range.top() == 0
+ tableRowCount = model->rowCount(parent);
+ tableColCount = model->columnCount(parent);
+ if (tableRowCount * tableColCount > 100
+ && range.top() == 0
&& range.left() == 0
- && range.bottom() == model->rowCount(parent) - 1
- && range.right() == model->columnCount(parent) - 1) {
+ && range.bottom() == tableRowCount - 1
+ && range.right() == tableColCount - 1) {
tableSelected = true;
tableParent = parent;
- tableColCount = model->columnCount(parent);
- tableRowCount = model->rowCount(parent);
return;
}
}