[Qt-interest] QWebKit not displaying images from disk

Girish Ramakrishnan girish at forwardbias.in
Wed Jun 3 07:06:00 CEST 2009


Marc Bowes wrote:
> 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?
> 

I think ':' is a reserved character, so you have to encode it (i.e as %xx).

Girish



More information about the Qt-interest-old mailing list