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

@@ -233,6 +233,20 @@ void MaterialEditorContextObject::setHasQuick3DImport(bool b)
emit hasQuick3DImportChanged();
}
bool MaterialEditorContextObject::hasModelSelection() const
{
return m_hasModelSelection;
}
void MaterialEditorContextObject::setHasModelSelection(bool b)
{
if (b == m_hasModelSelection)
return;
m_hasModelSelection = b;
emit hasModelSelectionChanged();
}
void MaterialEditorContextObject::setSelectedMaterial(const ModelNode &matNode)
{
m_selectedMaterial = matNode;