From c5be8e21690a16026ef8281e66c57a668433c96a Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 30 Dec 2024 18:58:17 +0200 Subject: [PATCH] QmlDesigner: Fix 2 "property not defined" qml errors in texture editor ...by setting the context properties in the constructor. Also remove some unused includes. Change-Id: Ibb7901b79b5a97552fee7cf8428f35293451dbc4 Reviewed-by: Ali Kianian --- .../components/textureeditor/textureeditorqmlbackend.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp index 0e73e068eff..4e46a82f2b0 100644 --- a/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp @@ -5,7 +5,6 @@ #include "assetimageprovider.h" #include "bindingproperty.h" -#include "documentmanager.h" #include "nodemetainfo.h" #include "propertyeditorvalue.h" #include "qmldesignerconstants.h" @@ -16,17 +15,11 @@ #include -#include -#include #include -#include #include #include -#include -#include #include -#include #include #include #include @@ -58,6 +51,8 @@ TextureEditorQmlBackend::TextureEditorQmlBackend(TextureEditorView *textureEdito m_contextObject->setBackendValues(&m_backendValuesPropertyMap); m_contextObject->setModel(textureEditor->model()); context()->setContextObject(m_contextObject.get()); + context()->setContextProperty("hasTexture", QVariant(false)); + context()->setContextProperty("modelNodeBackend", &m_backendModelNode); QObject::connect(&m_backendValuesPropertyMap, &DesignerPropertyMap::valueChanged, textureEditor, &TextureEditorView::changeValue);