开发者

QTreeView switch tab positions

开发者 https://www.devze.com 2023-02-09 10:52 出处:网络
I have a qt objectQTreeView and I want to switch tab positions. Basicly i have a filled TreeView. And the function

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开发者_Python百科 return 50 for the first column and 0 for the second. How do i do that?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消