QmlDesigner: Fix scene root finding logic

If there's a single node child on View3D, detect that as scene root
when another non-node direct child of View3D is selected.

Change-Id: Ib538b0ae368e7b460700a99e4c450a15586c2f62
Fixes: QDS-1865
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2020-03-30 13:17:00 +03:00
parent 7a7ee71f22
commit cbb7099902

View File

@@ -745,7 +745,7 @@ QObject *Qt5InformationNodeInstanceServer::find3DSceneRoot(const ServerNodeInsta
view = qobject_cast<QQuick3DViewport *>(parentInstance.internalObject()); view = qobject_cast<QQuick3DViewport *>(parentInstance.internalObject());
int nodeCount = countChildNodes(view); int nodeCount = countChildNodes(view);
if (nodeCount == 1) if (nodeCount == 1)
return checkInstance.internalObject(); return childNode;
else else
return view->scene(); return view->scene();
} else if (parentInstance.isSubclassOf("QQuick3DNode")) { } else if (parentInstance.isSubclassOf("QQuick3DNode")) {