Hi all!
I am most probably asking stupid questions but I am new to Qt instrumentary so please don't judje me too hard *blush*
I am also implementing QTreeView with drag&drop for item reordering and I don't get one thing: how will I be able to move nodes under the root node since it is invisible?
To make myself more clear, here's the illustration:
Qt Code:
[root] | - A | - D | - E | - B | - CTo copy to clipboard, switch view to plain text mode
And say I want to move D to the root _after_ B. How shall I do this? If I drag the D over the B then D will become child of B, won't it?
And another question: inserting new elements to the tree. I've read the Simple Tree Model Example and Editable Tree Model Example but one thing is left unclear to me: how do I insert a new element as a child of the root element? As far as I understood the position of the new element is determined by current selection in the QTreeView: the new element is inserted as a child of selected element. But I can't select the root element since it's invisible! How is this issue resolved? Maybe just make a pseudo-root inside the real root and place all my items in it?
Thanks in advance!
Bookmarks