Hello all,
After a long and frustrating time searching for answers on how to create a QTreeView working on a QAbstractItemModel that supports drag & drop, I always found half working examples. I finally found an example that worked:
http://www.java2s.com/Code/Cpp/Qt/QT...raganddrop.htm
I was SO happy! But, it was missing one crucial step: It did not copy/move entire branch. It could work with many nodes at once (multi-selection), but it did not copy the children of those nodes.
I coded the extra step and I wanted to share it with you, so nobody would need to suffer like I did.
So, here's the code to drag and drop any nodes and their children inside a QTreeView!
BTW, it is not a professional software, as it do not catch all errors, but it will do what was advertised!
Bookmarks