2 Attachment(s)
QTableWidget, WordWrap not working with ResizeToContents
Hello,
I'm using a QTableWidget with 3 columns, and I want the last one to be vertically resized to display all the content with wordWraping.
It's working, but sometimes, depending on the content and the table width (the window can be resized), the word wrap fails !!!
Here an example where it failed :
Attachment 12576
The text shall end with "[...] AAA BBB CCC", but it's truncated.
- The last column is using all available space, with the property "horizontalHeaderStretchLastSection"
- ElideMode is set to None because I don't want Ellipsis, I want to see all the text
- To have multilines, I set wordWrap Enabled and configure vertical Header to be resized to the content :
Code:
ui.
tableWidget->verticalHeader
()->setSectionResizeMode
(QHeaderView::ResizeToContents);
I also tried to manually call resizeRowsToContents() but the result is the same
(I'm using Qt5.4.2)
I made a simple example, you can resize the window to illustrate the issue :
Attachment 12577
Am I doing something wrong ? Do you have any clues ?
Re: QTableWidget, WordWrap not working with ResizeToContents
Quote:
It's working, but sometimes, depending on the content and the table width (the window can be resized), the word wrap fails !!!
Do you mean that sometimes the word-wrap works, and sometimes it does not work?
Re: QTableWidget, WordWrap not working with ResizeToContents
Yes. And I don't see why.
Re: QTableWidget, WordWrap not working with ResizeToContents
Works just fine on macOS Qt 5.9.0.
Re: QTableWidget, WordWrap not working with ResizeToContents
I just tried on v5.9.1 (windows) and I have the same issue.