QmlDesigner: Allow deleting materials using the delete action

Fixes: QDS-7012
Change-Id: I5eb03971d33a997fc1463ec4ee70eb33a730a897
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2022-08-04 12:40:06 +03:00
parent 01bb84b808
commit ec565eea99
12 changed files with 97 additions and 24 deletions

View File

@@ -201,6 +201,12 @@ void MaterialBrowserModel::removeMaterial(const ModelNode &material)
}
}
void MaterialBrowserModel::deleteSelectedMaterial()
{
if (isValidIndex(m_selectedIndex))
m_materialList[m_selectedIndex].destroy();
}
void MaterialBrowserModel::updateSelectedMaterial()
{
selectMaterial(m_selectedIndex, true);