Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Drag'n'Drop with QListView
kukuyok last edited by
Hello everyone! I have created 3 my own classes inheriting from QAbstractListModel, QListView and QItemDelegate which work together like MVC. I'm creating browser like view and I need to use a child of QAbstractItemView like a Drag'n'Drop widget, interacting with another applications. I've achieved realization of drag operation, but I'm not able to launch drop operation. What I have done:
- Reimplemented methods of QAbstractListModel:
- For a child of QListView I've implemented next settings:
Gave myself up to despair, I've reimplemented dragEnterEvent() for a child of QListView too (with use after QListView::dragEnterEvent(e)). It shows that MIME object comes to my widget and has correctly data. But no one call to drop-methods of a child of QAbstractListModel occurs.
Does anybody see a foolish thing in my actions?)
goetz last edited by
You might need to (re)implement draMoveEvent() and dropEvent() too. Depending on your use case, dragLeaveEvent() too.