How can I get the width of a table widget... I don't mean width(), but the maximum possible sum of the column widths (without needing horizontal scroll bar)?
How can I get the width of a table widget... I don't mean width(), but the maximum possible sum of the column widths (without needing horizontal scroll bar)?
hmmm. I looked into the Qt Assistent of Qt4 and came along this function:
Qt Code:
//Returns the size of the viewport as if the scroll bars had no valid scrolling range.To copy to clipboard, switch view to plain text mode
Maybe it's what you need, i dont use Qt4 but Qt3
..:: Still Standing Strong ::..
magland (14th June 2007)
At least I haven't found any better way than summing QTableView::columnWidth()'s up together. "Contents size" is quite commonly requested feature for all QAbstractItemView derived classes. Someone should send a suggestion to TT..
J-P Nurmi
Thanks. Well that's a good step, but I also want to exclude the headers (and I guess space between columns if that exists). I just want to set the column widths so as to use the maximum space... seems like a fairly common task. But perhaps there's no good way to do it right now.
Bookmarks