QmlDesigner: Disable apply material to selected when no selection exist

When there is no valid model selected, disable the "apply to selected"
actions in the material editor and browser.

Change-Id: Id8e771c64e69c0ba2f42dff01d19ffbf4afafb77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2022-05-24 14:14:14 +03:00
parent c5818fc844
commit 71e553f497
8 changed files with 52 additions and 12 deletions

View File

@@ -677,6 +677,8 @@ void MaterialEditorView::selectedNodesChanged(const QList<ModelNode> &selectedNo
if (node.isSubclassOf("QtQuick3D.Model"))
m_selectedModels.append(node);
}
m_qmlBackEnd->contextObject()->setHasModelSelection(!m_selectedModels.isEmpty());
}
void MaterialEditorView::currentStateChanged(const ModelNode &node)