Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Unsolved Rendering elements outside of the page view?

    Qt WebKit
    1
    2
    647
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Z
      zrevek last edited by

      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?

      Z 1 Reply Last reply Reply Quote 0
      • Z
        zrevek @zrevek last edited by

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

            this->page()->setViewportSize(this->page()->mainFrame()->contentsSize());
        

        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.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post