Important: Please read the Qt Code of Conduct -

Rendering elements outside of the page view?

  • If I set an element at, say, { position: absolute; left: -100px; top: -100px; width: 50px; height: 50px } and then try to call,

        render(&painter, QPoint(), QRegion(rct));

    such that it includes that element, I just get a blank result. I get a similar result if I try to render something that is outside the bounds of what the browser thinks of as its current view. This makes perfect sense as an optimization, but is there any way for me to tell the QWebView to just render everything so that I can get snapshots of things whether or not they're strictly visible to the browser's users? Currently using Qt 5.3 in case that matters.

    As a related query, let's say the above is possible. Is it also possible in QtWebEngine?

  • @zrevek Note that though this seems similar to something that might be solved with,


    the trouble is that absolutely position elements existing entirely to upper left of the view's (0,0) origin don't appear to affect contentsSize and adding elements that only expand the page to the upper left of origin don't even fire the contentsSizeChanged signal.

Log in to reply