Find and share HowTos to various installations / configurations!
2 posts • Page 1 of 1
2 posts
• Page 1 of 1
Samarkin
Posts:2
Joined: Thu Jan 19, 2017 2:04 pm
Resize column in Tree Widget
Postby Samarkin »
Hello!
I want to change column size when I resize Tree Widget. How can i do this? There is a function "resizeMode" but it is obsolete from version 3.12.
And another question: How to know the width of a column in a Tree Widget? There is a function "setColumnWidth" but there is no function "get..." or similar.
1) There's currently only the possibility to set this property via a stylesheet. E.g. in the init script of the TreeWidget use
this.styleSheet = "QHeaderView { qproperty-stretchLastSection: true; }";
(for the behavior of the columns use the Tree function "setColumnWidthMode" / "setResizeEnabled")
2) There's currently no "getColumnWidth" function and no other way to query it, sorry.