Resize column in Tree Widget

Find and share HowTos to various installations / configurations!
2 posts • Page 1 of 1
Samarkin
Posts:2
Joined: Thu Jan 19, 2017 2:04 pm

Resize column in Tree Widget

Post by 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.

Image

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.

BR
Anton Samarkin
Attachments
png.png

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: Resize column in Tree Widget

Post by mkoller »

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.

2 posts • Page 1 of 1