diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2021-11-30 14:57:18 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2021-12-02 08:09:58 +0000 |
commit | 26ba5bdb0cbe69c2b51f2e00dd70f56932feffb3 (patch) | |
tree | 36b87101f80396dc75fc0895cd5337d5bc3f0d06 | |
parent | eadc9cb0e3f7c007c79e01dd96e4bd0a56066f3b (diff) |
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>
-rw-r--r-- | share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp index 195fd805f4..03b28bbf65 100644 --- a/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp +++ b/share/qtcreator/qml/qmlpuppet/qmlprivategate/qmlprivategate_56.cpp @@ -61,6 +61,10 @@ #include <private/qqmlmetatype_p.h> #include <private/qqmltimer_p.h> +#ifdef QUICK3D_MODULE +#include <private/qquick3dobject_p.h> +#endif + namespace QmlDesigner { namespace Internal { @@ -374,6 +378,11 @@ void doComponentCompleteRecursive(QObject *object, NodeInstanceServer *nodeInsta if (item && DesignerSupport::isComponentComplete(item)) return; +#ifdef QUICK3D_MODULE + auto obj3d = qobject_cast<QQuick3DObject *>(object); + if (obj3d && QQuick3DObjectPrivate::get(obj3d)->componentComplete) + return; +#endif if (!nodeInstanceServer->hasInstanceForObject(item)) emitComponentComplete(object); |