PDA

View Full Version : Drag and Drop Events on Pixmap Thumbnails attached to Qlabel



Nfrancisj
14th May 2016, 17:58
I have a set of Labels which have Pixmaps attached to them. These are thumbnails set within a GridLayout.
I would like to be able to drag around my thumbnails into other layouts as if I'm sorting/arranging them.
How would I setup a system to do that, when Qlable doesn't have drag/drop features?

Thanks :)

anda_skoa
15th May 2016, 08:36
All widgets can support drag&drop, the respective event handling methods are part of the QWidget API.
So it is both possible to have a label subclass that is the source as well as the target of such an operation.

If you mean drag&drop in the sense of manually rearranging display content you might want to look at QGraphicsView instead.

Cheers,
_