From 8aa9fae33a690340c9dac6ca4843ebb924dcff3f Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Tue, 28 Feb 2023 12:25:59 +0200 Subject: [PATCH] QmlDesigner: Use real texture path for bundle texture drag Icon path was set to MIME_TYPE_BUNDLE_TEXTURE data, leading to the icon getting imported instead of actual texture when dragging to a 3D model in the navigator. Change-Id: I9c44933135100b732d5a8c79b51830b938e0137a Reviewed-by: Mahmoud Badri --- .../components/contentlibrary/contentlibrarywidget.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp index 07f385e3046..8af947a6b1d 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp @@ -68,7 +68,7 @@ bool ContentLibraryWidget::eventFilter(QObject *obj, QEvent *event) if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 20 && m_textureToDrag->isDownloaded()) { QMimeData *mimeData = new QMimeData; - mimeData->setData(Constants::MIME_TYPE_BUNDLE_TEXTURE, {m_textureToDrag->iconPath().toUtf8()}); + mimeData->setData(Constants::MIME_TYPE_BUNDLE_TEXTURE, {m_textureToDrag->realTexturePath().toUtf8()}); // Allows standard file drag-n-drop. As of now needed to drop on Assets view mimeData->setUrls({QUrl::fromLocalFile(m_textureToDrag->realTexturePath())});