summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2010-07-29 07:46:48 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2010-07-29 07:46:48 (GMT)
commit940b5b23268193d58d7e229bf97a22276098790b (patch)
treeaf532e70e2646012b6a856bab48a105389bc2098 /src/gui/itemviews
parentd1e1f49ea0b742fd655112fdb30f5751e142a766 (diff)
parent0041606aefae5da0ff6c8187540f3eff33cbb643 (diff)
downloadQt-940b5b23268193d58d7e229bf97a22276098790b.zip
Qt-940b5b23268193d58d7e229bf97a22276098790b.tar.gz
Qt-940b5b23268193d58d7e229bf97a22276098790b.tar.bz2
Merge remote branch 'origin/4.6' into 4.7-from-4.6
Conflicts: src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebKit/qt/ChangeLog src/gui/itemviews/qlistview.cpp tests/auto/qlistview/tst_qlistview.cpp tests/auto/qnetworkreply/test/test.pro tests/auto/qsocks5socketengine/qsocks5socketengine.pro
Diffstat (limited to 'src/gui/itemviews')
-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 1869093..76d7642 100644
--- a/src/gui/itemviews/qlistview.cpp
+++ b/src/gui/itemviews/qlistview.cpp
@@ -2782,7 +2782,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)
@@ -2913,6 +2916,8 @@ void QIconModeViewBase::doDynamicLayout(const QListViewLayoutInfo &info)
else
contentsSize.rwidth() += info.spacing;
}
+ if (rect.size().isEmpty())
+ return;
// resize tree
int insertFrom = info.first;
if (done || info.first == 0) {