From 30941d228ec642c93f307b3dab4b4946b1b0bd7a Mon Sep 17 00:00:00 2001 From: Mahmoud Badri Date: Mon, 30 Oct 2023 12:15:05 +0200 Subject: [PATCH] EffectMaker: Remove anchor backend warning from color editor Change-Id: I2709e42337f026f69b0535fc40a2a91cda745ebd Reviewed-by: Amr Elsayed Reviewed-by: Miikka Heikkinen Reviewed-by: Qt CI Patch Build Bot --- src/plugins/effectmakernew/effectmakerwidget.cpp | 1 + src/plugins/effectmakernew/effectmakerwidget.h | 2 ++ .../components/materialeditor/materialeditorqmlbackend.cpp | 2 +- .../components/materialeditor/materialeditorqmlbackend.h | 4 ++-- .../qmldesigner/components/propertyeditor/gradientmodel.cpp | 2 +- .../components/propertyeditor/propertyeditorqmlbackend.cpp | 2 +- .../components/propertyeditor/propertyeditorqmlbackend.h | 4 ++-- .../components/propertyeditor/qmlanchorbindingproxy.cpp | 4 ---- .../components/propertyeditor/qmlanchorbindingproxy.h | 5 +---- .../components/propertyeditor/quick2propertyeditorview.cpp | 2 +- .../components/textureeditor/textureeditorqmlbackend.cpp | 2 +- .../components/textureeditor/textureeditorqmlbackend.h | 4 ++-- 12 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/plugins/effectmakernew/effectmakerwidget.cpp b/src/plugins/effectmakernew/effectmakerwidget.cpp index ed396113080..0199d2eca2a 100644 --- a/src/plugins/effectmakernew/effectmakerwidget.cpp +++ b/src/plugins/effectmakernew/effectmakerwidget.cpp @@ -134,6 +134,7 @@ void EffectMakerWidget::initView() m_quickWidget->rootContext()->setContextObject(ctxObj); m_backendModelNode.setup(m_effectMakerView->rootModelNode()); + m_quickWidget->rootContext()->setContextProperty("anchorBackend", &m_backendAnchorBinding); m_quickWidget->rootContext()->setContextProperty("modelNodeBackend", &m_backendModelNode); // init the first load of the QML UI elements diff --git a/src/plugins/effectmakernew/effectmakerwidget.h b/src/plugins/effectmakernew/effectmakerwidget.h index 6f55cbc786e..24efac7b586 100644 --- a/src/plugins/effectmakernew/effectmakerwidget.h +++ b/src/plugins/effectmakernew/effectmakerwidget.h @@ -3,6 +3,7 @@ #pragma once +#include "qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h" #include "qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h" #include @@ -54,6 +55,7 @@ private: QPointer m_effectMakerView; QPointer m_quickWidget; QmlDesigner::QmlModelNodeProxy m_backendModelNode; + QmlDesigner::QmlAnchorBindingProxy m_backendAnchorBinding; }; } // namespace EffectMaker diff --git a/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.cpp index fe84c0c1841..f0ce34a0e62 100644 --- a/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.cpp @@ -206,7 +206,7 @@ void MaterialEditorQmlBackend::setSource(const QUrl &url) m_view->setSource(url); } -Internal::QmlAnchorBindingProxy &MaterialEditorQmlBackend::backendAnchorBinding() +QmlAnchorBindingProxy &MaterialEditorQmlBackend::backendAnchorBinding() { return m_backendAnchorBinding; } diff --git a/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.h b/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.h index c405334bd0e..65649329a23 100644 --- a/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.h +++ b/src/plugins/qmldesigner/components/materialeditor/materialeditorqmlbackend.h @@ -38,7 +38,7 @@ public: MaterialEditorContextObject *contextObject() const; QQuickWidget *widget() const; void setSource(const QUrl &url); - Internal::QmlAnchorBindingProxy &backendAnchorBinding(); + QmlAnchorBindingProxy &backendAnchorBinding(); void updateMaterialPreview(const QPixmap &pixmap); DesignerPropertyMap &backendValuesPropertyMap(); MaterialEditorTransaction *materialEditorTransaction() const; @@ -59,7 +59,7 @@ private: PropertyName auxNamePostFix(const PropertyName &propertyName); QQuickWidget *m_view = nullptr; - Internal::QmlAnchorBindingProxy m_backendAnchorBinding; + QmlAnchorBindingProxy m_backendAnchorBinding; QmlModelNodeProxy m_backendModelNode; DesignerPropertyMap m_backendValuesPropertyMap; QScopedPointer m_materialEditorTransaction; diff --git a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp index b435322c39d..cadca2fd604 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/gradientmodel.cpp @@ -573,7 +573,7 @@ void GradientModel::setAnchorBackend(const QVariant &anchorBackend) auto anchorBackendObject = anchorBackend.value(); const auto backendCasted = - qobject_cast(anchorBackendObject); + qobject_cast(anchorBackendObject); if (backendCasted) m_itemNode = backendCasted->getItemNode(); diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp index 2e49befd9e1..393183f57c4 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.cpp @@ -400,7 +400,7 @@ void PropertyEditorQmlBackend::setSource(const QUrl &url) } } -Internal::QmlAnchorBindingProxy &PropertyEditorQmlBackend::backendAnchorBinding() +QmlAnchorBindingProxy &PropertyEditorQmlBackend::backendAnchorBinding() { return m_backendAnchorBinding; } diff --git a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h index b369a417e20..64cca972071 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h +++ b/src/plugins/qmldesigner/components/propertyeditor/propertyeditorqmlbackend.h @@ -41,7 +41,7 @@ public: PropertyEditorContextObject* contextObject(); QQuickWidget *widget(); void setSource(const QUrl& url); - Internal::QmlAnchorBindingProxy &backendAnchorBinding(); + QmlAnchorBindingProxy &backendAnchorBinding(); DesignerPropertyMap &backendValuesPropertyMap(); PropertyEditorTransaction *propertyEditorTransaction(); @@ -88,7 +88,7 @@ private: private: Quick2PropertyEditorView *m_view; - Internal::QmlAnchorBindingProxy m_backendAnchorBinding; + QmlAnchorBindingProxy m_backendAnchorBinding; QmlModelNodeProxy m_backendModelNode; DesignerPropertyMap m_backendValuesPropertyMap; QScopedPointer m_propertyEditorTransaction; diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp index c28602e7307..140828756aa 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.cpp @@ -52,8 +52,6 @@ static inline void restoreProperty(const ModelNode &node, const PropertyName &pr node.variantProperty(propertyName).setValue(*value); } -namespace Internal { - QmlAnchorBindingProxy::QmlAnchorBindingProxy(QObject *parent) : QObject(parent), m_relativeTopTarget(SameEdge), m_relativeBottomTarget(SameEdge), @@ -1132,6 +1130,4 @@ void QmlAnchorBindingProxy::setDefaultAnchorTarget(const ModelNode &modelNode) m_rightTarget = modelNode; } -} // namespace Internal } // namespace QmlDesigner - diff --git a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h index 4f65af289dc..2bb38980790 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h +++ b/src/plugins/qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h @@ -13,9 +13,7 @@ namespace QmlDesigner { class NodeInstanceView; -namespace Internal { - -class QmlAnchorBindingProxy : public QObject +class QMLDESIGNERCORE_EXPORT QmlAnchorBindingProxy : public QObject { Q_OBJECT @@ -222,5 +220,4 @@ private: bool m_ignoreQml; }; -} // namespace Internal } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp index 1c0071ee91b..15f69afc3fd 100644 --- a/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp +++ b/src/plugins/qmldesigner/components/propertyeditor/quick2propertyeditorview.cpp @@ -53,7 +53,7 @@ void Quick2PropertyEditorView::registerQmlTypes() ItemFilterModel::registerDeclarativeType(); ListValidator::registerDeclarativeType(); ColorPaletteBackend::registerDeclarativeType(); - Internal::QmlAnchorBindingProxy::registerDeclarativeType(); + QmlAnchorBindingProxy::registerDeclarativeType(); BindingEditor::registerDeclarativeType(); ActionEditor::registerDeclarativeType(); AnnotationEditor::registerDeclarativeType(); diff --git a/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp b/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp index 1325ade10c7..0cf01cf6209 100644 --- a/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp +++ b/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.cpp @@ -172,7 +172,7 @@ void TextureEditorQmlBackend::setSource(const QUrl &url) m_view->setSource(url); } -Internal::QmlAnchorBindingProxy &TextureEditorQmlBackend::backendAnchorBinding() +QmlAnchorBindingProxy &TextureEditorQmlBackend::backendAnchorBinding() { return m_backendAnchorBinding; } diff --git a/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.h b/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.h index 241195bd70d..b6d3fddf22d 100644 --- a/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.h +++ b/src/plugins/qmldesigner/components/textureeditor/textureeditorqmlbackend.h @@ -39,7 +39,7 @@ public: TextureEditorContextObject *contextObject() const; QQuickWidget *widget() const; void setSource(const QUrl &url); - Internal::QmlAnchorBindingProxy &backendAnchorBinding(); + QmlAnchorBindingProxy &backendAnchorBinding(); DesignerPropertyMap &backendValuesPropertyMap(); TextureEditorTransaction *textureEditorTransaction() const; @@ -59,7 +59,7 @@ private: PropertyName auxNamePostFix(const PropertyName &propertyName); QQuickWidget *m_view = nullptr; - Internal::QmlAnchorBindingProxy m_backendAnchorBinding; + QmlAnchorBindingProxy m_backendAnchorBinding; QmlModelNodeProxy m_backendModelNode; DesignerPropertyMap m_backendValuesPropertyMap; QScopedPointer m_textureEditorTransaction;