QTreeView switch tab positions

664 Views Asked by At

I have a qt object QTreeView and I want to switch tab positions. Basicly i have a filled TreeView. And the function

columnViewportPosition ( int column ) 

returns 0 for the first column and let's say 50 for the second. I want to switch them so that the are displayed in a different order, so that columnViewportPosition would return 50 for the first column and 0 for the second. How do i do that?

1

There are 1 best solutions below

0
On BEST ANSWER

Found it out by myself. Its actually really easy.

If we just call the header() function to get the QHeaderView, it has all the necessary functions.

For example the function swapSections called with swapSections(1, 0) will swap the first and second column.