QmlDesigner: Fix picking 3D models from 2D view

Adding new nodes to the scene for some reason doesn't include them
to the full window render done for picking purposes. Changed the render
to be done via grabItem() on the target View3D instead, which seems to
work more reliably.

Fixes: QDS-12577
Change-Id: Ia5f01b9521fd898f8cf073f96d32fc31bf936a37
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Miikka Heikkinen
2024-04-23 16:12:53 +03:00
parent 63107ff2f7
commit c351e8c9c7

View File

@@ -490,9 +490,9 @@ void Qt5InformationNodeInstanceServer::getNodeAtMainScenePos(
auto viewObj = qobject_cast<QQuick3DViewport *>(view.internalObject());
if (viewObj) {
// Render the main view to make sure everything is up to date
// Render the target View3D to make sure everything is up to date
updateNodesRecursive(viewObj);
renderWindow();
grabItem(viewObj);
QPointF viewPos = viewObj->mapFromScene(pos);