Hi Guys
I've got a QTreeView that I've setup so that I can drag and drop a node within the tree.
That included reimplementing supportedDropActions(), mimeTypes(), mimeData(const QModelIndexList &indexes), bool dropMimeData(...) and removeRows().
Most of it works fine:
When I start the drag, mimeData() is called.
When I drop the node, dropMimeData(...) gets called - It creates a new node from the mimeData and insert the node into the data structure (between beginInsertRows() and endInsertRows() ).
It then automatically calls removeRows() which removes the original node.
But there are some occasions where I need to reject the drop. If I simply return false in dropMimeData,
the dragged node returns to its original position but then removeRows() is still called and the node gets removed.
If I set up a flag so that the node isn't removed within removeRows(), it leaves the row there but makes it invisible.
Does anyone know how to fix this?
Thanks
Jeff
Bookmarks