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/qqmlcontext_p.h | |
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/qqmlcontext_p.h')
-rw-r--r-- | src/qml/qml/qqmlcontext_p.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h index 5f7316b00c..f93393a11b 100644 --- a/src/qml/qml/qqmlcontext_p.h +++ b/src/qml/qml/qqmlcontext_p.h @@ -147,11 +147,16 @@ public: quint32 hasEmittedDestruction:1; quint32 isRootObjectInCreation:1; quint32 stronglyReferencedByParent:1; - quint32 dummy:25; + quint32 hasExtraObject:1; // used in QQmlDelegateModelItem::dataForObject to find the corresponding QQmlDelegateModelItem of an object + quint32 dummy:24; QQmlContext *publicContext; - // The incubator that is constructing this context if any - QQmlIncubatorPrivate *incubator; + union { + // The incubator that is constructing this context if any + QQmlIncubatorPrivate *incubator; + // a pointer to extra data, currently only used in QQmlDelegateModel + QObject *extraObject; + }; // Compilation unit for contexts that belong to a compiled type. QQmlRefPointer<QV4::ExecutableCompilationUnit> typeCompilationUnit; |