[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] QTreeWidget and fixed column widths on window resize
From:       "Tyler Distad" <tyler.distad () gmail ! com>
Date:       2008-07-31 23:39:08
Message-ID: 1bb620340807311639t5d71d620kb4028d1c9c86cdf () mail ! gmail ! com
[Download RAW message or body]

> Not really. From the docs:
>
> ----------------
>
> stretchLastSection : bool
> This property holds whether the last visible section in the header takes up
> all the available space.
> The default value is false.
> Note: The horizontal headers provided by QTreeView are configured with this
> property set to true, ensuring that the view does not waste any of the space
> assigned to it for its header.
> Also note: If the value is set to true, this property will override the resize
> mode set on the last section in the header.
>
> ----------------
>
> You need to unset stretchLastSection first, then set it to a fixed size.

Bingo. Thank you. That's exactly what I  needed.
Final result, for anyone's reference:

self.ui.myTreeWidget.header().setStretchLastSection(False)
self.ui.myTreeWidget.header().setResizeMode(0, QHeaderView.Stretch)
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic