-
Drag and drop
I have drag and drop implemented using a QTreeView (setItemsExpandable is false), and everything is working nicely. The problem I'm having, however, is that I need to get the row number that an item was dropped FROM when said item gets dropped (within the same view). Is there any way to do this?
-
Re: Drag and drop
If I am not mistaking, when you build the mime data and the drag data for drag and drop, in QTreeWidget::mimeData, you're being passed a list of QTreeWidgetItems.
Couldn't you find out the selected item's row here and include it somehow in the drag data?
-
Re: Drag and drop
I've considered doing this, and even tried to implement it. The problem is that it's just so messy. My reimplementation of QAbstractItemModel::mimeData() is passed at least 4 indexes at a time (4 colummns per row), so it turns into a logistical mess that feels pretty dirty.