[Qt-interest] Work around screen resolution in QWebView and/or JavaScript

Dirk Stöcker qtinterest at dstoecker.de
Wed Dec 17 18:07:56 CET 2008


Hello,

I got no answer the first time, so I try it a second time. I really found no 
solution for that problem, so any help is recommended.

I wrote a little Qt tool using WebKit to download a webpage as image. Now this 
works fine as long as the webpage is smaller than the physical screen or no 
JavaScript is involved.

The source is here:
http://svn.openstreetmap.org/applications/editors/josm/plugins/wmsplugin/webkit-image.cpp

It is pretty easy piece of source :-)

Now when I call this:
./webkit-image http://www.dstoecker.eu/ymap.html >x.jpg

the output file is reduced to my physical screen size of 1200 pixels in height 
due to the JavaScript code involved.

To get it working nevertheless I tried to convince Qt that I have no 1920x1200 
screen, but a much larger one, but till now I failed.

So my questions are:
a) Is there a way to convince the WebKit part of Qt to assume I have a much 
larger screen (maybe a way to convince JavaScript only)?
b) Is there a way to convince the whole Application that I have a larger 
screen?
c) Is there any other way how I can convince the whole software that it should 
use 2000x2000 instead of my physical screen limits?

The software does not show anything, so it really should not care for the 
physical screen dimensions.

Ciao
-- 
http://www.dstoecker.eu/ (PGP key available)



More information about the Qt-interest-old mailing list