[Qt-interest] QTable: set columns width to 100% of widget

Fabio Dago fabio.dago at sir.to.it
Wed Feb 11 15:56:44 CET 2009


Try this:

void QHeaderView::setStretchLastSection ( bool stretch )

QTableWidget* table = new QTableWidget(this);
table->horizontalHeader()->setStretchLastSection(true);


Regards

Miguel Cardenas ha scritto:
> Hello
>
> How can I set the columns to the 100% width of the QTable widget? I 
> want to avoid the blank space at the right of the columns, no matter 
> how many they are, one, two, three or more, want them to "pad" to the 
> right border of the widget. In case there are more than "X" columns 
> then want to appear the slide bars to avoid compress the columns so 
> the contents can't be viewed.
>
> How can I do that?
>
> Thanks
>
> -- 
> Miguel Cardenas
> ------------------------------------------------------------------------
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>   
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com 
> Version: 8.0.233 / Virus Database: 270.10.20/1944 - Release Date: 02/10/09 17:44:00
>
>   



More information about the Qt-interest-old mailing list