Commit 8a3d4891 authored by Albert Astals Cid's avatar Albert Astals Cid Committed by The Qt Project
Browse files

Do not return cacheItem->object if it is still incubating


It can happen that cacheItem->object in QQmlDelegateModelPrivate::object
already has a value but that the cacheItem->incubationTask is still
Loading. If we return the object here we can confuse some of QQmlDelegateModel
consumers like QQuickItemView.

E.g. in QQuickItemView if we get to return the object before the createdItem
signal is emitted we will make that when the createdItem signal happens
QQuickItemView::createdItem will be called it will add the item
to unrequestedItems items and will expect that layout/refill will
remove it from unrequestedItems if it is really one of the items we are
creating, but as it has been already created the item will wrongly remain
in unrequestedItems making the item view to act weird

Task-number: QTBUG-28403

Change-Id: I4359391eb2a4012afd3f01d082a99692d63b6639
Reviewed-by: default avatarAlan Alpert <aalpert@blackberry.com>
parent 0e9cd8b4
No related merge requests found
Showing with 8 additions and 3 deletions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment