diff options
author | Martin Jones <martin.jones@nokia.com> | 2011-02-02 04:01:04 (GMT) |
---|---|---|
committer | Martin Jones <martin.jones@nokia.com> | 2011-02-02 04:01:04 (GMT) |
commit | 13d59acef59952e07d98c2947c25da33418c2465 (patch) | |
tree | 7b50f12cafbdf720cbab27d149830867b2fb3e99 /src/declarative/graphicsitems/qdeclarativelistview.cpp | |
parent | 08fc37fbb09173bad771b36d2be14a2a359c140e (diff) | |
download | Qt-13d59acef59952e07d98c2947c25da33418c2465.zip Qt-13d59acef59952e07d98c2947c25da33418c2465.tar.gz Qt-13d59acef59952e07d98c2947c25da33418c2465.tar.bz2 |
Changing header or footer failed to delete the previous.
Also ensure that the view is repositioned if the change of header
results in the view being out of bounds.
Task-number: QTBUG-16522
Reviewed-by: Michael Brasser
Diffstat (limited to 'src/declarative/graphicsitems/qdeclarativelistview.cpp')
-rw-r--r-- | src/declarative/graphicsitems/qdeclarativelistview.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/declarative/graphicsitems/qdeclarativelistview.cpp b/src/declarative/graphicsitems/qdeclarativelistview.cpp index cbc4311..075c3af 100644 --- a/src/declarative/graphicsitems/qdeclarativelistview.cpp +++ b/src/declarative/graphicsitems/qdeclarativelistview.cpp @@ -2232,6 +2232,9 @@ void QDeclarativeListView::setFooter(QDeclarativeComponent *footer) Q_D(QDeclarativeListView); if (d->footerComponent != footer) { if (d->footer) { + if (scene()) + scene()->removeItem(d->footer->item); + d->footer->item->deleteLater(); delete d->footer; d->footer = 0; } @@ -2241,6 +2244,7 @@ void QDeclarativeListView::setFooter(QDeclarativeComponent *footer) if (isComponentComplete()) { d->updateFooter(); d->updateViewport(); + d->fixupPosition(); } emit footerChanged(); } @@ -2266,6 +2270,9 @@ void QDeclarativeListView::setHeader(QDeclarativeComponent *header) Q_D(QDeclarativeListView); if (d->headerComponent != header) { if (d->header) { + if (scene()) + scene()->removeItem(d->header->item); + d->header->item->deleteLater(); delete d->header; d->header = 0; } @@ -2276,6 +2283,7 @@ void QDeclarativeListView::setHeader(QDeclarativeComponent *header) d->updateHeader(); d->updateFooter(); d->updateViewport(); + d->fixupPosition(); } emit headerChanged(); } |