[webkit-qt] how to load image from QImage in QWebView?

Ariya Hidayat ariya.hidayat at gmail.com
Fri Apr 1 08:04:26 PDT 2011

> QWebView* webView;
> webView->setPage(new WebPage);
> webView->setHtml("<html> <head> </head> <body> <img src='mydata://test.png'>
> </body> </html>");
> The test.png was read into an instance of QImage from database.
> The problem is how to make test.png displayed in the webView.
> I have customized WebPage::acceptNavigationRequest,

That's definitely not how you do it. See Noam's example:
http://labs.qt.nokia.com/2010/11/16/some-webkit-hybrid-stuff/ for the
proper way to implement this idea.

Ariya Hidayat

More information about the webkit-qt mailing list