QmlDesigner: Allow dragging image Assets to the Material Browser

When dragging an image from the Assets Library to the Textures section
of the Material Browser, now Textures will be created from those
assets.

Task-number: QDS-8783
Change-Id: Ibbfb8697705a7d1af7714f3a32caff24282ee7a9
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
Samuel Ghinet
2023-02-01 12:10:34 +02:00
parent d42af9246f
commit 192ac5db61
10 changed files with 46 additions and 4 deletions

View File

@@ -216,6 +216,17 @@ WidgetInfo MaterialBrowserView::widgetInfo()
tr("Material Browser view"));
}
void MaterialBrowserView::createTextures(const QStringList &assetPaths)
{
auto *create = new CreateTextures(this, false);
executeInTransaction("MaterialBrowserView::createTextures", [&]() {
create->execute(assetPaths, AddTextureMode::Texture, m_sceneId);
});
create->deleteLater();
}
void MaterialBrowserView::modelAttached(Model *model)
{
AbstractView::modelAttached(model);