summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-07-27 16:49:00 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-07-27 16:49:00 (GMT)
commitf5f025f55d42adcc37c3708ac5aa321c1fac0aff (patch)
tree751c12d263d02903bfb11bf655dc746082ab25e8 /src
parentc21b143c58b22ed564b04bd79b1b17776cf306e2 (diff)
parent3c7e7992461b1fef37ada68244f1b5b891015bda (diff)
downloadQt-f5f025f55d42adcc37c3708ac5aa321c1fac0aff.zip
Qt-f5f025f55d42adcc37c3708ac5aa321c1fac0aff.tar.gz
Qt-f5f025f55d42adcc37c3708ac5aa321c1fac0aff.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix crash when all the items in a QListView are hidden
Diffstat (limited to 'src')
-rw-r--r--src/gui/itemviews/qlistview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/itemviews/qlistview.cpp b/src/gui/itemviews/qlistview.cpp
index b2def39..64ae0db 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2773,7 +2773,10 @@ QPoint QIconModeViewBase::initDynamicLayout(const QListViewLayoutInfo &info)
y = info.bounds.y() + info.spacing;
items.reserve(rowCount() - hiddenCount());
} else {
- const QListViewItem item = items.at(info.first - 1);
+ int idx = info.first - 1;
+ while (idx > 0 && !items.at(idx).isValid())
+ --idx;
+ const QListViewItem &item = items.at(idx);
x = item.x;
y = item.y;
if (info.flow == QListView::LeftToRight)
@@ -2899,6 +2902,8 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info)
// resize the content area
if (done || !info.bounds.contains(item->rect()))
contentsSize = QSize(rect.width(), rect.height());
+ if (rect.size().isEmpty())
+ return;
// resize tree
int insertFrom = info.first;
if (done || info.first == 0) {