[webkit-qt] QGraphicsWebView - resize to contents - Help?

Felipe Crochik felipe at crochik.com
Mon Mar 21 14:50:57 PDT 2011

I really must be missing something obvious but I can't figure out what.


I have a QGraphicsWebView on a scene added to QGraphicsView. For "static"
pages I can just use setResizesToContents(true) or manually resize my
QGraphicsWebView when the main frame fires the "contentsSizeChanged" signal
and everything works.


But when I have a "dynamic" page, like the mobile gmail, I have a big
problem. If I use the setResizesToContents or process the main frame
contentsSizeChanged signal I end up on an infiite loop. 


Changing the size of the "QGraphicsWebView" triggers the javascript on the
page to resize the contents to always be a little bit larger than the
visible area that then make the mainframe size larger and I have to make the
QGraphicsWebView and there we go again . 


If I only change the size of QGraphicsWebView once after the page is loaded
I still end up with a scroll bar on my QGraphicsWebView because the
javascript on the page will resize the contents/mainframe after I change the
size of the QGraphicsWebView


It is such a "basic" problem that I can only assume there must be an obvious


Thanks in advance,


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20110321/23c945bd/attachment.html>

More information about the webkit-qt mailing list