QmlDesigner: Fix right click selection on 3D view

Right click on 3D view will now always clear selection if
there is no model under the cursor when click happens.

Fixes: QDS-12227
Change-Id: I922fc79472ced4a3aa5e518c03731edf240e1d43
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:
Miikka Heikkinen
2024-03-14 11:59:48 +02:00
parent 5a85490d4c
commit b6318addef

View File

@@ -705,8 +705,13 @@ void Edit3DView::showContextMenu()
if (m_nodeAtPosReqType == NodeAtPosReqType::ContextMenu) if (m_nodeAtPosReqType == NodeAtPosReqType::ContextMenu)
return; return;
if (m_contextMenuPendingNode.isValid() && !m_contextMenuPendingNode.isSelected()) if (m_contextMenuPendingNode.isValid()) {
if (!m_contextMenuPendingNode.isSelected())
setSelectedModelNode(m_contextMenuPendingNode); setSelectedModelNode(m_contextMenuPendingNode);
} else {
clearSelectedModelNodes();
}
m_edit3DWidget->showContextMenu(m_contextMenuPosMouse, m_contextMenuPendingNode, m_contextMenuPos3D); m_edit3DWidget->showContextMenu(m_contextMenuPosMouse, m_contextMenuPendingNode, m_contextMenuPos3D);
m_contextMenuPendingNode = {}; m_contextMenuPendingNode = {};
} }