diff options
author | Martin Jones <martin.jones@nokia.com> | 2010-07-14 05:32:32 (GMT) |
---|---|---|
committer | Toby Tomkins <toby.tomkins@nokia.com> | 2010-07-15 03:22:04 (GMT) |
commit | 9585d98469903df64c6772d37c6aa71a2f82389c (patch) | |
tree | 77cbb1b5d074525f258f47e111b6e9f4761ba1f0 /src | |
parent | 339ae395817867f44736c20df714986e52b8c9a9 (diff) | |
download | Qt-9585d98469903df64c6772d37c6aa71a2f82389c.zip Qt-9585d98469903df64c6772d37c6aa71a2f82389c.tar.gz Qt-9585d98469903df64c6772d37c6aa71a2f82389c.tar.bz2 |
Position GridView and ListView footer correctly when model cleared.
Task-number: QTBUG-12167
(cherry picked from commit 9adc85fdfa0af2b6948408932188ee1b79247fa6)
Diffstat (limited to 'src')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativegridview.cpp | 5 | ||||
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativegridview.cpp b/src/declarative/graphicsitems/qdeclarativegridview.cpp index 3efb9ad..078d034 100644 --- a/src/declarative/graphicsitems/qdeclarativegridview.cpp +++ b/src/declarative/graphicsitems/qdeclarativegridview.cpp @@ -2438,8 +2438,11 @@ void QDeclarativeGridView::itemsRemoved(int modelIndex, int count) if (removedVisible && d->visibleItems.isEmpty()) { d->timeline.clear(); d->setPosition(0); - if (d->itemCount == 0) + if (d->itemCount == 0) { + d->updateHeader(); + d->updateFooter(); update(); + } } emit countChanged(); diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index 9cc414a..42b953c 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -1077,7 +1077,7 @@ void QDeclarativeListViewPrivate::updateFooter() } if (footer) { if (visibleItems.count()) { - qreal endPos = endPosition(); + qreal endPos = endPosition() + 1; if (lastVisibleIndex() == model->count()-1) { footer->setPosition(endPos); } else { @@ -2893,8 +2893,11 @@ void QDeclarativeListView::itemsRemoved(int modelIndex, int count) d->visiblePos = d->header ? d->header->size() : 0; d->timeline.clear(); d->setPosition(0); - if (d->itemCount == 0) + if (d->itemCount == 0) { + d->updateHeader(); + d->updateFooter(); update(); + } } emit countChanged(); |