PDA

View Full Version : QTableView->resizeColumnsToContents()



AttilaPethe
16th June 2011, 22:24
Hi,
how can I found the real, whole (partly not visible) size of a QTableView after a QTableView->resizeColumnsToContents(). I want to resize the parent of it to make the width of the QTableView to be visible without scrollbar. I do not need the current size with scrollbar! Thanks for any idea, Attila

Santosh Reddy
16th June 2011, 22:39
Add all the columnWidth() and vertical header width in the QTableView, and then set this calculated size to the QTreeWidget.

ChrisW67
16th June 2011, 23:45
...and be prepared for the situation where your table is wider than the screen or simply crowds out anything around it.

wysota
17th June 2011, 01:01
QAbstractScrollArea::maximumViewportSize() is a useful method. Especially if you substract the value from the width of the scroll area widget.

AttilaPethe
18th June 2011, 09:44
Thanks for ideas, I have to try out! Attila