forked from qt-creator/qt-creator
QmlDesigner: Select model under cursor when using "Edit in 3D View"
If selection context contains valid scene position, use that to select the model under cursor. Fixes: QDS-12346 Change-Id: I55c58ed303e1746b7b234fa6ac31272fdfafb40d Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -1688,7 +1688,14 @@ void editIn3dView(const SelectionContext &selectionContext)
|
||||
if (selectionContext.view() && selectionContext.hasSingleSelectedModelNode()
|
||||
&& selectionContext.currentSingleSelectedNode().metaInfo().isQtQuick3DView3D()) {
|
||||
QmlDesignerPlugin::instance()->mainWidget()->showDockWidget("Editor3D", true);
|
||||
const QPointF scenePos = selectionContext.scenePosition();
|
||||
if (scenePos.isNull()) {
|
||||
selectionContext.view()->emitView3DAction(View3DActionType::AlignViewToCamera, true);
|
||||
} else {
|
||||
selectionContext.view()->emitCustomNotification("pick_3d_node_from_2d_scene",
|
||||
{selectionContext.currentSingleSelectedNode()},
|
||||
{scenePos});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user