开发者

Images not loading in QWebview in PyQt4 in py2exe

开发者 https://www.devze.com 2023-01-01 12:37 出处:网络
I have an application that displays some HTML in a QWebview, which references images on the local file system. This works fine directly running the python. When compiling via py2exe, the images no lon

I have an application that displays some HTML in a QWebview, which references images on the local file system. This works fine directly running the python. When compiling via py2exe, the images no longer load. Google doesn't seem t开发者_开发问答o know the answer, any ideas?


Only png support is native, jpg (and others) is supplied via plugins.

Don't recall the exact paths (and I don't know your platform) but search for the PyQt plugins folder and:

  1. Copy the plugins folder to: $yourprogram/PyQt4/plugins (along with qt.conf)
  2. Edit qt.conf, and change prefix to $yourprogram/PyQt4

You might also need to convince py2exe to also include this folder (verbatim).

0

精彩评论

暂无评论...
验证码 换一张
取 消