Itemview (copy/paste)
-
Hello experts,
I have tree QTreeView and I have my own model (sub class of QAbstractItemModel), In My tree I have Four top level nodes say A1..to A4 and each of them having child nodes say b1 and b2 and and b1 and b2 have child c1.
If user want to click on b2 copy(via context menu) and paste on A3, I want All child of b2 should be inserted as child of A3, Can any one please let me know how i should do it? similarly if some one drag and drop i.e. drag b2 and drop on A3it should work like Cut and paste.
I will appreciate if you guys can point me to some docuemnt for this or to some code snippet -
This [http://www.java2s.com/Code/Cpp/Qt/QTreeViewdraganddrop.htm] example is a good one to start with. Eventually you can modify code to copy the child elements as well.
-
Hi there, actually I tried that example,
but even in drag and drop it is not dropping the child items of the Dragged item.Can any one please give some insight what should I do to have all the Child items of the dragged item gets dropped on the target item?
-
[http://www.java2s.com/Code/Cpp/Qt/QTreeViewdraganddrop.htm]
I am not able to access that link... :(