How to drag a qml element to a widget
-
Hi,
AFAIK, you can use drag by setting Drag.dragType to Drag.Automatic and set Drag.mimeData to base64 data of the Image and then on the other widget for eg. QLabel get the base64 data, decode it using fromBase64 and apply using QPixmap.
-
[quote author="p3c0" date="1409904422"]Hi,
AFAIK, you can use drag by setting Drag.dragType to Drag.Automatic and set Drag.mimeData to base64 data of the Image and then on the other widget for eg. QLabel get the base64 data, decode it using fromBase64 and apply using QPixmap.[/quote]
Sorry, can you provide a demo ? -
Can you show what you have started with ? Any trials ? In this way it would be easier for you to understand.
You might need to check "Drag":http://qt-project.org/doc/qt-5/qml-qtquick-drag.html and it's this "example":http://qt-project.org/doc/qt-5/qtquick-externaldraganddrop-example.html. Just use Image element instead of Text.
Waiting for you to try this first :)