[PyQt] Detecting if a column has been resized by the user; auto-stretching columns.

Lukas Hetzenecker LuHe at gmx.at
Mon Aug 17 23:27:07 BST 2009


Hello,

just found this thread and wanted to know if it is possible to auto-stretch 
the _first_ column?

Thanks,
Lukas

Am Donnerstag 04 Dezember 2008 01:07:56 schrieb David Boddie:
> On Wed Dec 3 17:10:00 GMT 2008, Anonymous wrote:
> > Thanks for the response, but i saw that in the documentation before
> > asking, and it's not what i'm looking for. The columns for my purpose do
> > not need to be fully stretched out, i just need the last column in the
> > view to auto-stretch if there is space for it to take up.
>
> Then there is a solution. It's quite well hidden:
>
>   tableWidget.horizontalHeader().setStretchLastSection(True)
>
> It's the header that handles the width of each column, which is obvious
> if you think about tables in a certain way, but it seems to catch a lot
> of people out.
>
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt


More information about the PyQt mailing list