QmlDesigner: Implement "duplicate material" feature

Fixes: QDS-7013
Change-Id: I28a11dbd9d6586631c0edcf8003e551917eaac98
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Mahmoud Badri
2022-05-25 21:42:15 +03:00
parent e2f20ddcd5
commit 0b51afe21d
7 changed files with 81 additions and 46 deletions

View File

@@ -246,11 +246,14 @@ void MaterialBrowserModel::selectMaterial(int idx, bool force)
}
}
void MaterialBrowserModel::deleteMaterial(qint32 internalId)
void MaterialBrowserModel::duplicateMaterial(int idx)
{
int idx = m_materialIndexHash.value(internalId);
if (isValidIndex(idx))
m_materialList[idx].destroy();
emit duplicateMaterialTriggered(m_materialList.at(idx));
}
void MaterialBrowserModel::deleteMaterial(int idx)
{
m_materialList[idx].destroy();
}
void MaterialBrowserModel::renameMaterial(int idx, const QString &newName)