EffectMaker: Remove anchor backend warning from color editor

Change-Id: I2709e42337f026f69b0535fc40a2a91cda745ebd
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Mahmoud Badri
2023-10-30 12:15:05 +02:00
parent 354da91222
commit 30941d228e
12 changed files with 15 additions and 19 deletions

View File

@@ -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

View File

@@ -3,6 +3,7 @@
#pragma once
#include "qmldesigner/components/propertyeditor/qmlanchorbindingproxy.h"
#include "qmldesigner/components/propertyeditor/qmlmodelnodeproxy.h"
#include <coreplugin/icontext.h>
@@ -54,6 +55,7 @@ private:
QPointer<EffectMakerView> m_effectMakerView;
QPointer<StudioQuickWidget> m_quickWidget;
QmlDesigner::QmlModelNodeProxy m_backendModelNode;
QmlDesigner::QmlAnchorBindingProxy m_backendAnchorBinding;
};
} // namespace EffectMaker

View File

@@ -206,7 +206,7 @@ void MaterialEditorQmlBackend::setSource(const QUrl &url)
m_view->setSource(url);
}
Internal::QmlAnchorBindingProxy &MaterialEditorQmlBackend::backendAnchorBinding()
QmlAnchorBindingProxy &MaterialEditorQmlBackend::backendAnchorBinding()
{
return m_backendAnchorBinding;
}

View File

@@ -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<MaterialEditorTransaction> m_materialEditorTransaction;

View File

@@ -573,7 +573,7 @@ void GradientModel::setAnchorBackend(const QVariant &anchorBackend)
auto anchorBackendObject = anchorBackend.value<QObject*>();
const auto backendCasted =
qobject_cast<const QmlDesigner::Internal::QmlAnchorBindingProxy *>(anchorBackendObject);
qobject_cast<const QmlDesigner::QmlAnchorBindingProxy *>(anchorBackendObject);
if (backendCasted)
m_itemNode = backendCasted->getItemNode();

View File

@@ -400,7 +400,7 @@ void PropertyEditorQmlBackend::setSource(const QUrl &url)
}
}
Internal::QmlAnchorBindingProxy &PropertyEditorQmlBackend::backendAnchorBinding()
QmlAnchorBindingProxy &PropertyEditorQmlBackend::backendAnchorBinding()
{
return m_backendAnchorBinding;
}

View File

@@ -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<PropertyEditorTransaction> m_propertyEditorTransaction;

View File

@@ -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

View File

@@ -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

View File

@@ -53,7 +53,7 @@ void Quick2PropertyEditorView::registerQmlTypes()
ItemFilterModel::registerDeclarativeType();
ListValidator::registerDeclarativeType();
ColorPaletteBackend::registerDeclarativeType();
Internal::QmlAnchorBindingProxy::registerDeclarativeType();
QmlAnchorBindingProxy::registerDeclarativeType();
BindingEditor::registerDeclarativeType();
ActionEditor::registerDeclarativeType();
AnnotationEditor::registerDeclarativeType();

View File

@@ -172,7 +172,7 @@ void TextureEditorQmlBackend::setSource(const QUrl &url)
m_view->setSource(url);
}
Internal::QmlAnchorBindingProxy &TextureEditorQmlBackend::backendAnchorBinding()
QmlAnchorBindingProxy &TextureEditorQmlBackend::backendAnchorBinding()
{
return m_backendAnchorBinding;
}

View File

@@ -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<TextureEditorTransaction> m_textureEditorTransaction;