PDA

View Full Version : Why does QWebView sizeHint() return a fixed value?



JPNaude
4th January 2011, 10:38
Hi

I'm wondering what the reason is that QWebView::sizeHint() is implemented to return a fixed value:



QSize QWebView::sizeHint() const
{
return QSize(800, 600); // ####...
}


It makes putting it into a layout pretty useless. On that point, is there a recommended way to let QWebView respect a layout? I've reimplemented the resizeEvent() and got it working, but why is it needed?

Thanks for any comments.
Jaco

franz
4th January 2011, 14:15
Try setting the size policy. The size hint is just a hint and usage of it is dependent on the size policy as far as I know.

Even so, putting the thing into a layout may still be useful whenever other widgets come into play, but that is probably out of scope here.

JPNaude
4th January 2011, 14:51
Setting the size policy did it thanks.