I have a QListWidget which I fill with filenames (the filename without path is the item’s text, and the full path is in the item’s tooltip). I want to be able to drag, for example, a movie file to VLC from my QListWidget, and VLC should start to play it – the same as if I had dragged it from a file manager.
I’ve tried reading the documentation on Drag&Drop, but couldn’t figure out how to do it. I have set dragEnabled property to true, and dragDropMode property to DragOnly. Now I can start a drag, but if I drag a list item to VLC nothing happens (which isn’t surprising).
I wanted to do the exact same thing, here is what I came up with. It works on Windows, but I haven’t tested on other platforms.