Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set column width for QTableWidget in designtime

I cannot find any information for the following question: is there a possibility to set width to columns for QTableWidget in designtime. When I opened ui-file in text editor, I found, that columns are declared like this:

<column>
    <property name="text" >
        <string>My column name</string>
    </property>
</column>

I tried to add some properties like width, but had no success.

The only question I found at qtcentre.org is this. But unfortunaly it is without an answer.

Thank you for advise (even if it would be "You can't").

P.S. Please, do not answer, that I can do it in runtime like this:

table->headerView()->resizeSection( columnIdx, width );
like image 722
borisbn Avatar asked Feb 21 '13 13:02

borisbn


People also ask

How do I change the size of a column in QTableWidget?

horizontalHeader()->setResizeMode( 0, QHeaderView::Stretch ); to make the first column resize so the QTableWidget is always full. Override the resizeEvent and set the widths of each column yourself when the QTableWidget has been resized.

How do I resize a column width in HTML?

Use the style attribute with the width or height properties to specify the size of a table, row or column.


1 Answers

It is not possible, at least not with Qt Designer 2.5.2. Designer only offer a limited set of customization.

like image 148
UmNyobe Avatar answered Sep 18 '22 09:09

UmNyobe