diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-04-09 19:46:04 +0100 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2016-04-12 12:44:45 +0000 |
commit | 6737083f5c743820af5e7c0424f265911a412ba7 (patch) | |
tree | 6905b255bee4434c803c67a7c1b4a9f488792884 /src/core/aspects | |
parent | c598dfdbec92963ec4e7107a5f266f119fd09214 (diff) |
Add QNodeDestroyedChange and send from QNode dtor
Taking care not to do this recursively. One event can take care of
notifying the backend of an entire sub-tree being destroyed.
Change-Id: Iabf849317943b982eebac72e201e117c2f174026
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/aspects')
-rw-r--r-- | src/core/aspects/qaspectengine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/aspects/qaspectengine.cpp b/src/core/aspects/qaspectengine.cpp index b76aae603..6a33c4536 100644 --- a/src/core/aspects/qaspectengine.cpp +++ b/src/core/aspects/qaspectengine.cpp @@ -109,6 +109,13 @@ void QAspectEnginePrivate::createCreationChange(QNode *node) { const auto creationChange = node->createNodeCreationChange(); m_creationChanges.push_back(creationChange); + + // Store the metaobject of the node in the QNode so that we have it available + // to us during destruction in the QNode destructor. This allows us to send + // the QNodeId and the metaobject as typeinfo to the backend aspects so they + // in turn can find the correct QBackendNodeMapper object to handle the destruction + // of the corresponding backend nodes. + QNodePrivate::get(node)->m_typeInfo = const_cast<QMetaObject*>(creationChange->metaObject()); } QAspectEngine::QAspectEngine(QObject *parent) |