[Qt-interest] QWebKit not displaying images from disk

Eric Clark eclark at ara.com
Tue Jun 2 22:57:39 CEST 2009


I ran into this exact problem before. You need to include the dlls for the image libraries. They need to be in a directory called imageformats that resides at the same level as your executable. In your Qt installation, the dlls reside in ./plugins/imageformats.

Eric

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Marc Bowes
Sent: Tuesday, June 02, 2009 3:38 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] QWebKit not displaying images from disk

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
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list