forked from qt-creator/qt-creator
QmlDesigner: Don't create material library node in in-file component
While there are some valid use cases for having a material library inside in-file component, having duplicate material library nodes in a single file causes some issues that are not trivial to solve, so for now we just prevent this from happening. Fixes: QDS-8656 Change-Id: I4495ea4d972eab76ca444d18ab4c45b403805ad7 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/messagebox.h>
|
||||
#include <designdocument.h>
|
||||
#include <designmodewidget.h>
|
||||
#include <propertyeditorqmlbackend.h>
|
||||
#include <utils/environment.h>
|
||||
@@ -62,7 +63,9 @@ TextureEditorView::TextureEditorView(AsynchronousImageCache &imageCache,
|
||||
m_ensureMatLibTimer.callOnTimeout([this] {
|
||||
if (model() && model()->rewriterView() && !model()->rewriterView()->hasIncompleteTypeInformation()
|
||||
&& model()->rewriterView()->errors().isEmpty()) {
|
||||
ensureMaterialLibraryNode();
|
||||
DesignDocument *doc = QmlDesignerPlugin::instance()->currentDesignDocument();
|
||||
if (doc && !doc->inFileComponentModelActive())
|
||||
ensureMaterialLibraryNode();
|
||||
if (m_qmlBackEnd && m_qmlBackEnd->contextObject())
|
||||
m_qmlBackEnd->contextObject()->setHasMaterialLibrary(materialLibraryNode().isValid());
|
||||
m_ensureMatLibTimer.stop();
|
||||
|
||||
Reference in New Issue
Block a user