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:
@@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include <auxiliarydataproperties.h>
|
#include <auxiliarydataproperties.h>
|
||||||
#include <bindingproperty.h>
|
#include <bindingproperty.h>
|
||||||
|
#include <designdocument.h>
|
||||||
#include <dynamicpropertiesmodel.h>
|
#include <dynamicpropertiesmodel.h>
|
||||||
#include <metainfo.h>
|
#include <metainfo.h>
|
||||||
#include <nodeinstanceview.h>
|
#include <nodeinstanceview.h>
|
||||||
@@ -60,7 +61,9 @@ MaterialEditorView::MaterialEditorView(ExternalDependenciesInterface &externalDe
|
|||||||
m_ensureMatLibTimer.callOnTimeout([this] {
|
m_ensureMatLibTimer.callOnTimeout([this] {
|
||||||
if (model() && model()->rewriterView() && !model()->rewriterView()->hasIncompleteTypeInformation()
|
if (model() && model()->rewriterView() && !model()->rewriterView()->hasIncompleteTypeInformation()
|
||||||
&& model()->rewriterView()->errors().isEmpty()) {
|
&& model()->rewriterView()->errors().isEmpty()) {
|
||||||
ensureMaterialLibraryNode();
|
DesignDocument *doc = QmlDesignerPlugin::instance()->currentDesignDocument();
|
||||||
|
if (doc && !doc->inFileComponentModelActive())
|
||||||
|
ensureMaterialLibraryNode();
|
||||||
if (m_qmlBackEnd && m_qmlBackEnd->contextObject())
|
if (m_qmlBackEnd && m_qmlBackEnd->contextObject())
|
||||||
m_qmlBackEnd->contextObject()->setHasMaterialLibrary(materialLibraryNode().isValid());
|
m_qmlBackEnd->contextObject()->setHasMaterialLibrary(materialLibraryNode().isValid());
|
||||||
m_ensureMatLibTimer.stop();
|
m_ensureMatLibTimer.stop();
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
#include <coreplugin/messagebox.h>
|
#include <coreplugin/messagebox.h>
|
||||||
|
#include <designdocument.h>
|
||||||
#include <designmodewidget.h>
|
#include <designmodewidget.h>
|
||||||
#include <propertyeditorqmlbackend.h>
|
#include <propertyeditorqmlbackend.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
@@ -62,7 +63,9 @@ TextureEditorView::TextureEditorView(AsynchronousImageCache &imageCache,
|
|||||||
m_ensureMatLibTimer.callOnTimeout([this] {
|
m_ensureMatLibTimer.callOnTimeout([this] {
|
||||||
if (model() && model()->rewriterView() && !model()->rewriterView()->hasIncompleteTypeInformation()
|
if (model() && model()->rewriterView() && !model()->rewriterView()->hasIncompleteTypeInformation()
|
||||||
&& model()->rewriterView()->errors().isEmpty()) {
|
&& model()->rewriterView()->errors().isEmpty()) {
|
||||||
ensureMaterialLibraryNode();
|
DesignDocument *doc = QmlDesignerPlugin::instance()->currentDesignDocument();
|
||||||
|
if (doc && !doc->inFileComponentModelActive())
|
||||||
|
ensureMaterialLibraryNode();
|
||||||
if (m_qmlBackEnd && m_qmlBackEnd->contextObject())
|
if (m_qmlBackEnd && m_qmlBackEnd->contextObject())
|
||||||
m_qmlBackEnd->contextObject()->setHasMaterialLibrary(materialLibraryNode().isValid());
|
m_qmlBackEnd->contextObject()->setHasMaterialLibrary(materialLibraryNode().isValid());
|
||||||
m_ensureMatLibTimer.stop();
|
m_ensureMatLibTimer.stop();
|
||||||
|
|||||||
Reference in New Issue
Block a user