pyqt应用程序被cx_freeze打包后丢失图标

发布于 2024-09-14 15:15:39 字数 387 浏览 2 评论 0原文

可能的重复:
运行冻结的 pyqt 时不显示图像另一台计算机上的应用程序

我有一个 pyqt 应用程序,其图标位于资源文件中。使用 python app.py 运行应用程序时我可以看到该图标。但是当我使用 cx_freeze 打包应用程序后,图标丢失了。我可以在“library.zip”(由cx_freeze生成)中看到编译后的资源,但图标仍然丢失。任何人都可以帮忙吗?谢谢。

Possible Duplicate:
Images not showing when running a frozen pyqt app on another computer

I have a pyqt application whose icon is in a resource file. I can see the icon when run the application using python app.py. But after I package the application using cx_freeze, the icon is missing. I can see the compiled resource in the `library.zip' (generated by cx_freeze), but the icon is still missing. Any one can help? Thanks.

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

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

发布评论

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

评论(1

筱武穆 2024-09-21 15:15:39

我遇到了这个问题,并且我使用了 .ico 文件作为图标。然而,当我使用 .gif 文件作为图标时,我又恢复了图标。希望这有帮助。

如果没有,请尝试不使用图标作为编译资源,而只是其目录中的普通文件。

I had this problem and I was using an .ico file for the icon. However when I used a .gif file for the icon instead, I got my icon back. Hope this helps.

If not, try not using the icon as a compiled resource, but just a normal file in its directory.

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