The problem is security restrictions in WebKit.
AFAIK. The idea is to prevent HTML pages from the Internet from including / referencing files on the hard drive, and for some reason, calling setHtml() makes WebKit think that HTML should not have access to files on the disk (using the file:// scheme file:// ).
I think I worked on this, letting WebKit know that the HTML set really comes from the hard drive itself and should have access to local files accordingly.
void QWebView::setHtml ( const QString & html, const QUrl & baseUrl = QUrl() )
It is not possible to test it here and now, but you can try to give baseUrl something like file://abcd .
Also, lack of PNG support can be a problem, so you should check if PNG support is enabled in your Qt build.
Try linking to a PNG image on the Internet (for example, http://files.iconfactory.net/news/CandyBar.png ) and see if it appears. If so, PNG is supported, and the problem is related to security restrictions in WebKit.
Bastiben
source share