0
votes

I'm looking for the simpliest way, using Qt Designer and a little code, to drag text from a QListWidget (apparently there are options of draggable content in Qt Designer) to a QLabel (but I can't find any droppable action option ...) so its text is set to the text of the item we dragged. Any ideas ?

[C++, Windows, Qt5]

1

1 Answers

1
votes

Well, yeah, the most straightforward idea is subclassing QLabel and reimplementing it's

void dropEvent(QDropEvent* event)

QDrag object will help you pass text from QListWidget via it's mimeData, just create one in mouse event handler.

Check similar questions or examples for more information.