图像未加载到 py2exe 中 PyQt4 的 QWebview 中

发布于 2024-09-03 09:46:45 字数 112 浏览 5 评论 0原文

我有一个在 QWebview 中显示一些 HTML 的应用程序,它引用本地文件系统上的图像。直接运行 python 就可以正常工作了。通过 py2exe 编译时,不再加载图像。谷歌似乎不知道答案,有什么想法吗?

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 to know the answer, any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

抠脚大汉 2024-09-10 09:46:45

只有 png 支持是原生的,jpg (和其他)是通过插件提供的。

不记得确切的路径(而且我不知道你的平台),但搜索 PyQt 插件文件夹并:

  1. 将插件文件夹复制到: $yourprogram/PyQt4/plugins (以及 qt.conf)
  2. 编辑 qt .conf,并将前缀更改为 $yourprogram/PyQt4

您可能还需要说服 py2exe 也包含此文件夹(逐字)。

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).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文