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 );
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.
Use the style attribute with the width or height properties to specify the size of a table, row or column.
It is not possible, at least not with Qt Designer 2.5.2. Designer only offer a limited set of customization.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With