Qt: QWebview not displaying jpg, gif, png images o

2019-06-25 05:22发布

问题:

Today I came across a very strange error with QWebView which I cannot resolve myself.

I included a QWebView widget in my application. When I set a URL or a piece of HTML code to display (with QWebView::setUrl() or QWebView::setHtml()), it works very well on my machine. It also works on all machines that have Qt installed, but not on those without it. I compiled a release build and included all necessary libraries as shared (QtWebKit4.dll, QtNetwork4.dll etc.), so I guess my error lies in that I forgot to include some libraries.

If anybody has already had such an error, I would be very grateful for help!

回答1:

You might need to include the relevant Qt image processing plugin libraries, which are located in qt/plugins/imageformats (and maybe also qt/plugins/iconengines ). I haven't deployed any webkit apps, so I'm not certain about this.



回答2:

See my answer to this question: Qt dll deployment on windows