Fix crash when all the items in a QListView are hidden
authorJason McDonald <jason.mcdonald@nokia.com>
Thu, 2 Sep 2010 04:13:14 +0000 (14:13 +1000)
committerJason McDonald <jason.mcdonald@nokia.com>
Thu, 2 Sep 2010 04:13:14 +0000 (14:13 +1000)
commitdaccbc9300abbfdc0baa6d4ef44d26cb81f0d01a
tree4d61fafdbd6904f498e6035dd566b1f6a23619d2
parent6e8c51e99e3704c1bbb50253e02701bea6911144
Fix crash when all the items in a QListView are hidden

Calling QIconModeViewBase::initDynamicLayout() on the second and
successive segments would return QPoint(-1,-1), resulting in a
totally empty area rectangle for all the items while in
QIconModeViewBase::doDynamicLayout(). This rectangle is used to
initialize the BSP tree, and produces an arithmetic exception when
empty.

Furthermore, a rendering bug was also apparent when displaying the
first item of a segment while the last item of the previous segment
was hidden.

Auto-tests included.

Reviewed-by: Olivier
Task-number: QTBUG-12308
(cherry picked from commit 3c7e7992461b1fef37ada68244f1b5b891015bda)

Conflicts:

src/gui/itemviews/qlistview.cpp
tests/auto/qlistview/tst_qlistview.cpp
src/gui/itemviews/qlistview.cpp
tests/auto/qlistview/tst_qlistview.cpp