How is your view set up? Does it have stretchLastColumn property set to true? What are the resize policies of the columns?
How is your view set up? Does it have stretchLastColumn property set to true? What are the resize policies of the columns?
Thank you so much for your quick response - it is appreciated. I'm using the Qt designer for this dialog, and all the items are set to the default except that I turned off word wrap and set the horizontal scroll bar to 'Always On'. I see a stretchHeaderLastSection, and that's checked. But I don't have a header, do I need one? The size policy for the QTreeView is Preferred, Expanding. I don't see a stretchLastColumn property or resize policies for individual columns - I must be looking in the wrong place, where do I find those? I set the resizeColumnToContents(0), but it doesn't seem to make a difference. Thanks again for your help.
Switch it off.
With a tree view you always have a header, it might not be visible though.But I don't have a header, do I need one?
In the docs of QHeaderViewI don't see a stretchLastColumn property or resize policies for individual columns - I must be looking in the wrong place, where do I find those?
Bad idea.I set the resizeColumnToContents(0)
LynneV (9th November 2010)
The solution ended up to be: QStandardItemModel->SetHorizontalHeaderLabels( QStringList) AND QTreeView->setColumnWidth( 0, line_width ). Ether alone would not work..but together they do the trick! Why is resizeColumntoContents not a good idea? Just curious.
LynneV (10th November 2010)
Bookmarks