Render QWebView without showing it



  • Hi All!

    I would like to render a QWebView widget without showing it, but it looks like it doesn't work. I want to print out a webpage, but don't want to show it on the GUI. I've successfully rendered QTextEdit and printed that in the past, but looks like it's not working with the webkit stuff, probably it relies on the render of the graphical system. If I load the webpage to the webview widget without showing it, the result is just an empty page.

    But if anyone knows a workaround, please share that, in the end I would like to have a CLI application of this project.



  • You can just use QWebPage and render() its mainFrame() directly. Take a look at the webcapture example [1] and the PhantomJS project [2].

    [1] http://qt.gitorious.org/qt-labs/graphics-dojo/trees/master/webcapture
    [2] http://www.phantomjs.org/



  • Thank you Peppe, I'll try that!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.