QmlDesigner: Update _pickTarget of Repeater3D created objects

The objects Repeater3D creates are created after handleInstanceHidden
is called for the repeater instance, so the _pickTarget of the created
children doesn't get properly updated. Added signal handler to
make sure handleInstanceHidden is called again after all objects have
been created.

Fixes: QDS-5643
Change-Id: I8b63614fca0be3956b6896028e3f3a0f49bfe397
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Miikka Heikkinen
2021-12-02 15:00:20 +02:00
parent b6a996a8d5
commit 9c15b5b16d
3 changed files with 42 additions and 0 deletions
@@ -25,6 +25,7 @@
#include "quick3dnodeinstance.h"
#include "qt5nodeinstanceserver.h"
#include "qt5informationnodeinstanceserver.h"
#include <qmlprivategate.h>
@@ -39,6 +40,7 @@
#include <private/qquick3dnode_p.h>
#include <private/qquick3dmodel_p.h>
#include <private/qquick3dnode_p_p.h>
#include <private/qquick3drepeater_p.h>
#endif
namespace QmlDesigner {
@@ -56,6 +58,14 @@ Quick3DNodeInstance::~Quick3DNodeInstance()
void Quick3DNodeInstance::initialize(const ObjectNodeInstance::Pointer &objectNodeInstance,
InstanceContainer::NodeFlags flags)
{
#ifdef QUICK3D_MODULE
if (auto repObj = qobject_cast<QQuick3DRepeater *>(object())) {
if (auto infoServer = qobject_cast<Qt5InformationNodeInstanceServer *>(nodeInstanceServer())) {
QObject::connect(repObj, &QQuick3DRepeater::objectAdded,
infoServer, &Qt5InformationNodeInstanceServer::handleRepeaterAddObject);
}
}
#endif
ObjectNodeInstance::initialize(objectNodeInstance, flags);
}