QmlDesigner: Implement Quick3DNodeInstance wrapper

We use Quick3DNodeInstance as a proxy class to wrap QQuick3DNode.
The access to private API like QQuick3DNodePrivate::setIsHiddenInEditor()
is restriced by such proxy classes.

Change-Id: If5191c3b730359000cf983c3af206dcffa07be74
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Pasi Keränen <pasi.keranen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Thomas Hartmann
2019-10-17 18:27:57 +02:00
parent b128d498b2
commit ac84f8a457
10 changed files with 177 additions and 6 deletions
@@ -39,6 +39,7 @@
#include "qt3dpresentationnodeinstance.h"
#include "quickitemnodeinstance.h"
#include "quick3dnodeinstance.h"
#include "nodeinstanceserver.h"
#include "instancecontainer.h"
@@ -170,6 +171,8 @@ Internal::ObjectNodeInstance::Pointer ServerNodeInstance::createInstance(QObject
instance = Internal::LayoutNodeInstance::create(objectToBeWrapped);
else if (isSubclassOf(objectToBeWrapped, "QQuickItem"))
instance = Internal::QuickItemNodeInstance::create(objectToBeWrapped);
else if (isSubclassOf(objectToBeWrapped, "QQuick3DNode"))
instance = Internal::Quick3DNodeInstance::create(objectToBeWrapped);
else if (isSubclassOf(objectToBeWrapped, "QQmlComponent"))
instance = Internal::ComponentNodeInstance::create(objectToBeWrapped);
else if (objectToBeWrapped->inherits("QQmlAnchorChanges"))
@@ -312,6 +315,11 @@ void ServerNodeInstance::setPropertyBinding(const PropertyName &name, const QStr
m_nodeInstance->setPropertyBinding(name, expression);
}
void ServerNodeInstance::setHideInEditor(bool b)
{
m_nodeInstance->setHideInEditor(b);
}
void ServerNodeInstance::resetProperty(const PropertyName &name)
{
m_nodeInstance->resetProperty(name);