PDA

View Full Version : QWebView not displaying images



andyp
2nd December 2009, 11:44
Does anyone have any idea why images would not be displayed in all web pages shown in a QWebView on a MAC (i386) ? This is true for all images in all web pages.
The same code, displaying the same web pages, shows images fine on linux and win32, and even on a Power PC MAC.

wysota
3rd December 2009, 09:46
Did you copy the image plugins to the target machine?

andyp
3rd December 2009, 14:08
Thanks for the reply.

Sorry, not sure what you mean. Our guru built QT on the MAC from source, as he did on the other machines, so I am not sure what these "image plugins" are. Are they things you have to include in the Qt build configuration ? Are they libraries or what ?

andyp
3rd December 2009, 15:04
Correction. I have just looked at the plugins directory and it seems correct. In there are libqgif.a plus all the others (png, jpeg, tiff etc.). Only static libraries are in there, presumably since Qt was configured to build with static libraries.

Other displays of gifs, jpegs etc. accessed via QPixmaps are working fine. The only problem is with images in a QWebView.

wysota
3rd December 2009, 16:34
Qt can't use plugins when built in static mode. You need to specifically add static plugins to your project's code. Refer to the docs on static plugins for details. Tell that to your guru as well :)

andyp
3rd December 2009, 17:19
Thanks. I had not intentionally (or even knowingly) wanted plugins to be used anyway.
You are the one who mentioned plugins. Does this mean that all gif/jpeg/png/tiff is via plugins (or static plugins when necessary) ?

If so, then why is there successful gif/jpeg/png/tiff support in other QObjects, namely QPixmap, which can load and display from such image files quite happily ?

It is only QWebView which has the problem.

andyp
3rd December 2009, 18:08
Apologies. GIFs, JPEGs and TIFFs are not working in QPixmaps either, PNG's are.
And we now find that PNG's are working in WebView (just can't get the staff these days).

You are no doubt absolutely correct about the static plugin scenario.
I will get our guy onto it tomorrow, once he surfaces out of his Brisbane cave.

Many thanks.

wysota
3rd December 2009, 21:35
PNG is not handled by a plugin. PNG and XPM are the only two formats that are handled by Qt library itself. All others are through plugins.