From 93cd068d3e6cadb78f007975853828be35a4e1c6 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 23 Jun 2022 15:37:26 +0300 Subject: [PATCH] QmlDesigner: Create material library at import change There are still rewriter issues with Qt5, where component library templates for models contain materials, so create material library when quick3d import is added to ensure we never need to create it when models are added. Change-Id: I7006a39228d316dbfd84f49d19c025bb42b6765c Reviewed-by: Mahmoud Badri --- .../components/materialeditor/materialeditorview.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp b/src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp index 7ab7cc090c5..8b3d6932741 100644 --- a/src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp +++ b/src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp @@ -718,6 +718,9 @@ void MaterialEditorView::importsChanged(const QList &addedImports, const m_hasQuick3DImport = model()->hasImport("QtQuick3D"); m_qmlBackEnd->contextObject()->setHasQuick3DImport(m_hasQuick3DImport); + if (m_hasQuick3DImport) + m_ensureMatLibTimer.start(500); + resetView(); }