QmlDesigner: Keep Qt 3D scenes from crashing

If we do not set the source property of the Q3DSPresentationItem
nothing is actually rendered.

If a scene is rendered in the puppet we get an invalid OpenGL context
when rendering in the qml2puppet.

Change-Id: I74db0df7de759e830499967bc6985745be291856
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Thomas Hartmann
2018-07-04 18:53:11 +02:00
parent aaec887b15
commit ca42e48dac
4 changed files with 104 additions and 0 deletions
@@ -36,6 +36,7 @@
#include "positionernodeinstance.h"
#include "layoutnodeinstance.h"
#include "debugoutputcommand.h"
#include "qt3presentationdnodeinstance.h"
#include "quickitemnodeinstance.h"
@@ -161,6 +162,8 @@ Internal::ObjectNodeInstance::Pointer ServerNodeInstance::createInstance(QObject
if (objectToBeWrapped == 0)
instance = Internal::DummyNodeInstance::create();
else if (isSubclassOf(objectToBeWrapped, "Q3DSPresentationItem"))
instance = Internal::Qt3DPresentationNodeInstance::create(objectToBeWrapped);
else if (isSubclassOf(objectToBeWrapped, "QQuickBasePositioner"))
instance = Internal::PositionerNodeInstance::create(objectToBeWrapped);
else if (isSubclassOf(objectToBeWrapped, "QQuickLayout"))