How can achieve drag and drop for tree than?
How can achieve drag and drop for tree than?
As I said earlier, you could store the dragged index in a persistant model index member and access that on drop.
Or you encode the drag object in the mime data such that you can get all the necessary information back.
Cheers,
_
I also thought about same points .... sure i will try and keep posted about it.
For second point i think i need to do recursion, right?
That depends on your tree/data.
If it can't change due to outside events during drag&drop, then you only need to know the "root" of the subtree you are dragging.
Cheers,
_
Ya true, but what if i need only those child which are dragged, i need to maintain some kind of lit or vector of its id's right? for this i need to do recursion.
If that is what you need then that is what you need.
E.g. if you drag a directory in a file system tree, the only thing you would need to know is the path of that directory, not for any of its children.
But if your data requires you to know the full subtree, then that is what you need to have access to.
Cheers,
_
Bookmarks