[Qt-interest] QWebKit not displaying images from disk

Marc Bowes marcbowes at gmail.com
Tue Jun 2 22:38:15 CEST 2009


Hi,

I have an application which renders some HTML into a QWebView using
setHtml. Occasionally, the renderer will insert an HTML img tag using
a file from disk. On Linux, this might look like:

<img alt="bar" src="file:///home/foo/bar.png" />

And on Windows:

<img alt="bar" src="file://C:/foo/bar.png" />

However, only the Linux version displays the image. If (on Windows) I
dump the HTML to disk and open in Firefox, then the image displays. I
can't find anything in the documentation which says if this behavior
is to be expected, or if it is a bug/anomaly on Windows (or on
Linux?). I'm guessing it's either a bug, or I need to change a setting
somewhere to allow QWebArea to read from disk - maybe its a domain
problem, given that the HTML isn't being rendered from the disk?

Thanks,
Marc



More information about the Qt-interest-old mailing list