QmlDesigner: Add effect maker composition node color value

Since no StudioControls ColorEditor exists, using the HelperWidgets
one and adding dummy context and backend to get it to work.

Task-number: QDS-10404
Change-Id: Ifc1506b4b1f761b6abf4144791f5b0397a90cdf0
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2023-08-24 15:21:52 +03:00
parent c496434ad8
commit 29a207c59f
10 changed files with 322 additions and 5 deletions

View File

@@ -3,11 +3,13 @@
#include "effectmakerwidget.h"
#include "coloreditorcontextobject.h"
#include "effectmakermodel.h"
#include "effectmakernodesmodel.h"
#include "effectmakerview.h"
#include "qmldesignerconstants.h"
#include "qmldesignerplugin.h"
#include "qqmlcontext.h"
#include "theme.h"
#include <coreplugin/icore.h>
@@ -65,6 +67,10 @@ EffectMakerWidget::EffectMakerWidget(EffectMakerView *view)
{"effectMakerModel", QVariant::fromValue(m_effectMakerModel.data())},
{"rootView", QVariant::fromValue(this)}});
auto colorEditorCtx = new ColorEditorContextObject(m_quickWidget->rootContext());
m_quickWidget->rootContext()->setContextObject(colorEditorCtx);
m_quickWidget->rootContext()->setContextProperty("modelNodeBackend", {});
// init the first load of the QML UI elements
reloadQmlSource();
}