1

The simplest PySide app shown below with a QWebView is showing webpages which have many but not all images missing. It is not consistent on whether it's gif, pngs or jpgs that are causing the problem. It might be something to do with the size of the image that is being downloaded.

from sys import exit
from PySide.QtGui import QApplication
from PySide.QtWebKit import QWebView, QWebPage

app = QApplication([])
webview = QWebView()

webview.show()

webview.load("http://bbc.co.uk")

exit(app.exec_())

My environment is a PySide=1.1.2 installed using easy_install into a Python 2.7 virtualenv running on a Windows 7 machine.

I looked for a setting to do with the size of images in the cache, which was one of my suspicions, but I can't find anything. The rest of the page loads correctly, including all the js and css parts.

Any advice as to what could be wrong here would be greatly appreciated.

luke.tunmer
  • 183
  • 6
  • Your code is fine and it works for me as expected. I don't see any missing images. Are you sure this is not a problem with your network? – Avaris Oct 26 '12 at 00:40
  • It's not just failing for me, it's also failing for my customer on their own network. Chrome or Firefox show the webpages correctly, too. Is the method of installation expected to work - a virtualenv with PySide easy_installed into it? – luke.tunmer Oct 26 '12 at 09:17
  • Ah, missed the `virtualenv` part. OK, to test it out, I created a venv, easy_installed PySide and run your script in it... Yes, images are missing. But _all_ images are missing, not some. That's because plugins directory is not correctly configured in the virtualenv PySide and PySide can't locate image plugins. Once that's sorted out, everything works out as expected. – Avaris Oct 26 '12 at 16:58
  • Thanks Avaris. That is exactly what the problem was. Well, it was initially that I had forgotten to run the post-install script, which got it working correctly in my development environment, and then I had to modify the generated dist folder from py2exe to get the plugins folder copied over. All working well now. – luke.tunmer Oct 29 '12 at 09:24

0 Answers0