Drag and Drop .png file into MS Word fails
-
There is an issue with QT5 Drag and drop: when .png file is dropped into MS Word 2013, the path to the file is displayed instead of image, but it works correctly when dropping the into a folder. Source code has the following structure:
qMimeData->setImageData(QImage(filePath));
qUrls.push_back(QUrl("file:///" + filePath));
qMimeData->setUrls(qUrls);
QDrag* qDrag = new QDrag(qWidget);
qDrag->setMimeData(qMimeData);
qDrag->exec(Qt::CopyAction | Qt::MoveAction, Qt::CopyAction);What can be the cause of the issue?
-
Hi,
What happens if you don't call setUrls ?
-
IIRC there is a convention that first added mime types have higher priority than later added ones.
If Word doesn't follow this convention and decides to take another mime-type there is nothing you can do.