diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-09-24 10:37:43 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2019-09-25 08:11:13 +0200 |
commit | 94a675cc7c2b90374d307fbeb70e590b7c5a733d (patch) | |
tree | 1ece392d1b469449c64db98f21c78d72511234c5 /src/qml/qml/qqmlincubator.cpp | |
parent | cbd6273833c5910c77748c15a8ac83cc5080bd71 (diff) |
QQmlDelegateModel: Fix QQmlDelegateModelItem::dataForObject
With required properties, we do not store the cache item as a context
object anymore. To fix this, we repurpose the (space of the) incubator
pointer of QQmlContextData to store the element there, and one of the
dummy bits as a flag to indicate the new usage.
Change-Id: I7cc435fc6781c603fe407411a60a6018239c972c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlincubator.cpp')
-rw-r--r-- | src/qml/qml/qqmlincubator.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp index 5c3ecbfb60..f0ef5360b0 100644 --- a/src/qml/qml/qqmlincubator.cpp +++ b/src/qml/qml/qqmlincubator.cpp @@ -61,7 +61,7 @@ void QQmlEnginePrivate::incubate(QQmlIncubator &i, QQmlContextData *forContext) QExplicitlySharedDataPointer<QQmlIncubatorPrivate> parentIncubator; QQmlContextData *cctxt = forContext; while (cctxt) { - if (cctxt->incubator) { + if (!cctxt->hasExtraObject && cctxt->incubator) { parentIncubator = cctxt->incubator; break; } @@ -149,7 +149,8 @@ void QQmlIncubatorPrivate::clear() } enginePriv = nullptr; if (!rootContext.isNull()) { - rootContext->incubator = nullptr; + if (!rootContext->hasExtraObject) + rootContext->incubator = nullptr; rootContext = nullptr; } |