QmlDesigner: Add scene root material support to material editor/browser

If the scene root item is Material subclass, material library is not
created for the scene. Material editor and browser functionalities that
relate to having material library are disabled.
Material editor will always show the material that is the scene root.

Fixes: QDS-7374
Change-Id: Icd1c212c17b59e4a2caa6b3b4d7e615e68b21eb9
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2022-08-11 12:45:05 +03:00
parent d4cc3fddc9
commit 2e8574bd76
12 changed files with 116 additions and 81 deletions

View File

@@ -127,6 +127,7 @@ void MaterialBrowserView::modelAttached(Model *model)
AbstractView::modelAttached(model);
m_widget->clearSearchFilter();
m_widget->materialBrowserModel()->setHasMaterialRoot(rootModelNode().isSubclassOf("QtQuick3D.Material"));
m_hasQuick3DImport = model->hasImport("QtQuick3D");
// Project load is already very busy and may even trigger puppet reset, so let's wait a moment