Reload material property groups when model changes

The property groups would be unloaded when a model is detached,
and it would be loaded when the model is attached.
The problem was that the unload function was missing for the
MaterialBrowserModel.

Task-number: QDS-7515
Change-Id: I89064a78552c10228c0b18e42c1e0df4a92fb4a6
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Ali Kianian
2022-10-20 17:06:58 +03:00
parent 0e7bb80408
commit f2f6f6e6cc
3 changed files with 30 additions and 14 deletions

View File

@@ -336,6 +336,11 @@ void MaterialBrowserView::modelAboutToBeDetached(Model *model)
{
m_widget->materialBrowserModel()->setMaterials({}, m_hasQuick3DImport);
if (m_propertyGroupsLoaded) {
m_propertyGroupsLoaded = false;
m_widget->materialBrowserModel()->unloadPropertyGroups();
}
AbstractView::modelAboutToBeDetached(model);
}