Solved QListWidget Drag and drop
-
Hello.
I want to drag from one QListWidget item and drop it to another. After his drop, I want to call one function.
All works but only if I click this dropped item in another QListWidget and I want to call this function automatic after drop item. Can someone help me or give a tip? -
@naax
SubclassQListWidget
and override dropEvent()?Though if problems receiving the drop event, possibly see https://stackoverflow.com/questions/53897601/qlistwidget-derived-drop-event-not-firing, https://stackoverflow.com/questions/53870847/qt-drop-event-not-firing
-
@naax
SubclassQListWidget
and override dropEvent()?Though if problems receiving the drop event, possibly see https://stackoverflow.com/questions/53897601/qlistwidget-derived-drop-event-not-firing, https://stackoverflow.com/questions/53870847/qt-drop-event-not-firing
-
@JonB
I used QAbstractItemView in .ui for both QListWidget (one to drag only and second to drop only). The next step was to click the second QListWidget / Go to slot... and I don't know how I can select here from this all options. Of course, if this is impossible and I don't need to write code for this what I want. -
Item is adding successfully, but I need to click and then my functions are called. I want to call this function when I drop item
-
Hi,
If you need to react specifically to the drop event then do as @JonB suggested and create a derived class. You can always then use it in designer through promotion.