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 <mahmoud.badri@qt.io>
This commit is contained in:
Miikka Heikkinen
2023-02-28 12:25:59 +02:00
parent 7bfe5bf323
commit 8aa9fae33a

View File

@@ -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())});