Moving items in QTreeView
-
Hello!!
I need to move items inside a QTreeView. With the QTreeView properties I can do it, but I need to avoid the case that I move an item inside another item. I don't want to create item children. I only want to move the items order.
How can I do it?
Thank you very much!
-
Hello!!
I need to move items inside a QTreeView. With the QTreeView properties I can do it, but I need to avoid the case that I move an item inside another item. I don't want to create item children. I only want to move the items order.
How can I do it?
Thank you very much!
@ivanicy
QTreeViewsimply displays the parent, child & sibling hierarchy of its model. Get things in the right place there and the treeview will reflect it. You cannot move items, remove them from where you don't want them and insert them where you do.but I need to avoid the case that I move an item inside another item. I don't want to create item children. I only want to move the items order.
You have to "move an item inside another item" if you want to change parent/child/depth. If only at sibling level, remove and re-insert as desired.