[Qt-interest] printing an off-screen QWebPage

Paul Miller paul at fxtech.com
Thu May 7 23:21:40 CEST 2009


Paul Miller wrote:
> Richard Moore wrote:
>>> What are the steps to construct a QWebPage *without a view* that can be
>>> printed and previewed?
>> The code in this demo I did the other week should help:
>> http://kdedevelopers.org/node/3932
> 
> Hey that's pretty cool. Makes a little more now sense now how to get a 
> QWebPage to render its output somewhere.
> 
> But it turns out this doesn't help. For fun I hooked up a real QWebView 
> and have my HTML rendering into it properly. When I attach it to a 
> QPrintPreviewDialog as before (connecting the paintRequested signal to 
> the web view's print slot), I'm *still* getting zero pages of output in 
> the preview.
> 
> Maybe I'm assuming too much. Does the QWebView/Page pass enough 
> information to the printer so it knows how big the output should be and 
> therefore how many pages it should be, or is that up to me?

Aha! My bad. I had hooked up to the wrong slot!! Working nicely now, and 
the new XSLT stuff in 4.5 is really really nice!

-- 
Paul Miller | paul at fxtech.com | www.fxtech.com | Got Tivo?




More information about the Qt-interest-old mailing list