forked from qt-creator/qt-creator
QmlDesigner: Fix puppet crash with nested Repeater3Ds
Repeater3D instance instantiated by another Repeater3D got its componentCompleted called twice because a repeater constructing a child repeater already completes the component as part of the process, and then we recursively complete the children again when completing the parent. Added a check to avoid duplicate completions. Fixes: QDS-5651 Change-Id: Iefc7deff4877df903f784396f2efd13468f604b7 Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -61,6 +61,10 @@
|
|||||||
#include <private/qqmlmetatype_p.h>
|
#include <private/qqmlmetatype_p.h>
|
||||||
#include <private/qqmltimer_p.h>
|
#include <private/qqmltimer_p.h>
|
||||||
|
|
||||||
|
#ifdef QUICK3D_MODULE
|
||||||
|
#include <private/qquick3dobject_p.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
@@ -374,6 +378,11 @@ void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInsta
|
|||||||
|
|
||||||
if (item && DesignerSupport::isComponentComplete(item))
|
if (item && DesignerSupport::isComponentComplete(item))
|
||||||
return;
|
return;
|
||||||
|
#ifdef QUICK3D_MODULE
|
||||||
|
auto obj3d = qobject_cast<QQuick3DObject *>(object);
|
||||||
|
if (obj3d && QQuick3DObjectPrivate::get(obj3d)->componentComplete)
|
||||||
|
return;
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!nodeInstanceServer->hasInstanceForObject(item))
|
if (!nodeInstanceServer->hasInstanceForObject(item))
|
||||||
emitComponentComplete(object);
|
emitComponentComplete(object);
|
||||||
|
Reference in New Issue
Block a user