forked from qt-creator/qt-creator
QmlDesigner: Don't create duplicate default texture instance
Whenever an operation involving an asset image would result in creation of a new texture node, it now checks first if a matching texture node already exists and uses that instead. Fixes: QDS-8435 Change-Id: I3d091aafcd09afdec897bc4da79789c1d84056e8 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -435,6 +435,10 @@ void MaterialBrowserView::customNotification(const AbstractView *view,
|
||||
int idx = m_widget->materialBrowserModel()->materialIndex(nodeList.first());
|
||||
if (idx != -1)
|
||||
m_widget->materialBrowserModel()->selectMaterial(idx);
|
||||
} else if (identifier == "selected_texture_changed") {
|
||||
int idx = m_widget->materialBrowserTexturesModel()->textureIndex(nodeList.first());
|
||||
if (idx != -1)
|
||||
m_widget->materialBrowserTexturesModel()->selectTexture(idx);
|
||||
} else if (identifier == "refresh_material_browser") {
|
||||
QTimer::singleShot(0, model(), [this]() {
|
||||
refreshModel(true);
|
||||
|
||||
Reference in New Issue
Block a user