diff options
Diffstat (limited to 'src/core/nodes/qnode.cpp')
-rw-r--r-- | src/core/nodes/qnode.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/nodes/qnode.cpp b/src/core/nodes/qnode.cpp index 7858a1c54..3c2bf3259 100644 --- a/src/core/nodes/qnode.cpp +++ b/src/core/nodes/qnode.cpp @@ -849,7 +849,10 @@ void NodePostConstructorInit::addNode(QNode *node) while (nextNode != nullptr && !m_nodesToConstruct.contains(QNodePrivate::get(nextNode))) nextNode = nextNode->parentNode(); - if (!nextNode) { + // An ancestor in the m_nodesToConstruct may already have been created (m_hasBackendNode) + // at this point (e.g. when a QComponent calls _q_ensureBackendNodeCreated()), + // that's why we also queue a creation request in this case. + if (!nextNode || QNodePrivate::get(nextNode)->m_hasBackendNode) { m_nodesToConstruct.append(QNodePrivate::get(node)); if (!m_requestedProcessing){ QMetaObject::invokeMethod(this, "processNodes", Qt::QueuedConnection); |