summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qitemselectionmodel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/itemviews/qitemselectionmodel.cpp')
-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;
}
}