EffectMaker: Enable using project assets as effect textures

Also fixed few warnings by adding dummy needed context properties.

Change-Id: Ieed0f9d409302ba9ff1409b9081cda942e46d2e9
Reviewed-by: Amr Elsayed <amr.elsayed@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
This commit is contained in:
Mahmoud Badri
2023-10-31 18:07:19 +02:00
parent b46d9de784
commit 6a5e7920ce
6 changed files with 29 additions and 10 deletions

View File

@@ -14,6 +14,8 @@
#include "qqmlcontext.h"
#include "theme.h"
#include "qmldesigner/components/propertyeditor/assetimageprovider.h"
#include <coreplugin/icore.h>
#include <studioquickwidget.h>
@@ -136,6 +138,11 @@ void EffectMakerWidget::initView()
m_backendModelNode.setup(m_effectMakerView->rootModelNode());
m_quickWidget->rootContext()->setContextProperty("anchorBackend", &m_backendAnchorBinding);
m_quickWidget->rootContext()->setContextProperty("modelNodeBackend", &m_backendModelNode);
m_quickWidget->rootContext()->setContextProperty("activeDragSuffix", "");
m_quickWidget->engine()->addImageProvider("qmldesigner_thumbnails",
new QmlDesigner::AssetImageProvider(
QmlDesigner::QmlDesignerPlugin::imageCache()));
// init the first load of the QML UI elements
reloadQmlSource();