forked from qt-creator/qt-creator
QmlDesigner: Check the existence of the view for the Camera View
For making sure that the scene is available, we should check both of the following nodes: * Scene manager * A scene root node among ancestors Fixes: QDS-13671 Change-Id: I7439727193b51e80a0500f8aab5a86c5c84d7f02 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
@@ -704,7 +704,16 @@ bool GeneralHelper::isSceneObject(QQuick3DNode *node) const
|
|||||||
|
|
||||||
const QQuick3DObject *sceneObject
|
const QQuick3DObject *sceneObject
|
||||||
= importSceneManager->m_nodeMap.value(objectPrivate->spatialNode, nullptr);
|
= importSceneManager->m_nodeMap.value(objectPrivate->spatialNode, nullptr);
|
||||||
return sceneObject != nullptr;
|
if (!sceneObject)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
QQuick3DNode *parentNode = node->parentNode();
|
||||||
|
while (parentNode) {
|
||||||
|
if (parentNode->inherits("QQuick3DSceneRootNode"))
|
||||||
|
return true;
|
||||||
|
parentNode = parentNode->parentNode();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Emitter gizmo model creation is done in C++ as creating dynamic properties and
|
// Emitter gizmo model creation is done in C++ as creating dynamic properties and
|
||||||
|
Reference in New Issue
Block a user