由cx_freeze打包后,pyqt应用程序丢失了图标 [英] pyqt application lost icon after packaged by cx_freeze
问题描述
我有一个pyqt应用程序,其图标位于资源文件中。使用python app.py运行应用程序时,我可以看到该图标。但是在我使用cx_freeze打包应用程序后,该图标丢失了。我可以在 library.zip(由cx_freeze生成)中看到已编译的资源,但是该图标仍然丢失。有人可以帮忙吗?谢谢。
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.
推荐答案
我遇到了这个问题,并且正在使用.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.
这篇关于由cx_freeze打包后,pyqt应用程序丢失了图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!