summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2010-02-09 12:05:09 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2010-02-09 12:22:34 (GMT)
commit997490b36b28bca877409de97a506c969840bc43 (patch)
treec04ad8e5768de23696aa143b6d0f6bc8f0c75f09 /src/gui/itemviews
parent884a36d300bbe9068d912550a4aeb581f8ce8b37 (diff)
downloadQt-997490b36b28bca877409de97a506c969840bc43.zip
Qt-997490b36b28bca877409de97a506c969840bc43.tar.gz
Qt-997490b36b28bca877409de97a506c969840bc43.tar.bz2
QListView: fix crash when hiding many of the lasts item in a QListView
Since 6c1388ee5a3c4796d hidden items are not taken in account when counting the scrollbar position, and so the vector may be smaller. Reviewed-by: Gabriel Task-number: QTBUG-7929
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qlistview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index 19b1e8c..b2def39 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2160,7 +2160,7 @@ void QListModeViewBase::scrollContentsBy(int dx, int dy, bool scrollElasticBand)
} else {
if (flowPositions.isEmpty())
return;
- const int max = flowPositions.count() - 1;
+ const int max = scrollValueMap.count() - 1;
if (vertical && flow() == QListView::TopToBottom && dy != 0) {
int currentValue = qBound(0, verticalValue, max);
int previousValue = qBound(0, currentValue + dy, max);