forked from qt-creator/qt-creator
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:
@@ -68,7 +68,7 @@ bool ContentLibraryWidget::eventFilter(QObject *obj, QEvent *event)
|
|||||||
if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 20
|
if ((me->globalPos() - m_dragStartPoint).manhattanLength() > 20
|
||||||
&& m_textureToDrag->isDownloaded()) {
|
&& m_textureToDrag->isDownloaded()) {
|
||||||
QMimeData *mimeData = new QMimeData;
|
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
|
// Allows standard file drag-n-drop. As of now needed to drop on Assets view
|
||||||
mimeData->setUrls({QUrl::fromLocalFile(m_textureToDrag->realTexturePath())});
|
mimeData->setUrls({QUrl::fromLocalFile(m_textureToDrag->realTexturePath())});
|
||||||
|
Reference in New Issue
Block a user