How to find best size for QTableWidget?
Hi,
I've got the following problem. I have one table (QTableWidget) and I want to find out the best size for this table. With best size I mean this size of the widget that if it is smaller with only one pixel so the scrollbars should appear.
I tried different ways to get the size of the table but with no particular luck. In some cases the size is small and scrollbars appear, on other cases the size is too big and there is extra space in the widget which is blank.
Any ideas how to find out this best size ?
Thanks,
Plamen
Re: How to find best size for QTableWidget?
hello,
have you tried
Quote:
QSize size () const
to get the size of your table (QTableWidget)?
Re: How to find best size for QTableWidget?
Yes, I tried. But size() returns the preferred size for the widget ( I think the size which is set with sizeHint() ).
Since QTableWidget is derivate class of QScrollArea, I think that I need a function which to tell me at what size the scrollbars will appear for the first time and this size should be considered for best size.
Re: How to find best size for QTableWidget?