Get sizeHint of a QLayout, doesn't update after adding items
It appears that QLayout doesn't update sizeHint() any time a new item is added. Instead it seems like it differs it to some future time. I realize this by adding some items, checking sizeHint of the layout and seeing that it doesn't change.
I need a way to get the sizeHint immediately after adding several items to the layout. This is part of a system where a user selects several widgets and then the new window size is the preferred size of the layout. The user can however adjust the size later so I can't just forcibly use the size policy system.
Any ideas on how to get the proper sizeHint from QLayout immediately after adding several items? Calling "update" on it doesn't appear to do it.
Re: Get sizeHint of a QLayout, doesn't update after adding items
Re: Get sizeHint of a QLayout, doesn't update after adding items
I've tried that and it doesn't change the situation.
I've also checked now that as I add the elements the sizeHint on all the individual elements appears to be correct.
Added after 14 minutes:
Tracking through the QT source the best I can say is that it is a defect in the QWidgetItemV2 class. The underlying widget has the correct sizeHint, but this LayoutItem wrapper is reporting 0,0 for max/min/hint sizes.
Now I have to look for a workaround.
Re: Get sizeHint of a QLayout, doesn't update after adding items
Does it return true or false?