pyinstaller 不加载应用程序图标

pyinstaller doesn't load app icon

在我的应用程序中,我使用 pyside-rcc 生成 qrc 文件

<RCC>
  <qresource prefix="/" >
    <file>images/icon.jpg</file>
  </qresource>
</RCC>

使用这个命令

pyside-rcc images.qrc -o images.py

然后我将它导入我的应用程序

import images

并设置应用程序图标

MainWindow.setWindowIcon(QtGui.QIcon(':/images/icon.jpg'))

当我 运行 我的申请 python

python app.py

能看到图标,没问题

但是当我用 pyinstaller 编译它时

pyinstaller -i icon.co -w app.py

icon.co只是位于主目录中的另一个文件,用于设置exe图标。

exe 有一个图标,但是当我在标题或头部打开我的应用程序时,图标 images/icon.jpg 没有加载,我也没有在工具栏中看到它。

我也试过添加Tree('path\to\images')但是没用!

这是非常琐碎的....只是使用 .png 而不是 .ico.jpg 来让它工作。

这对 .ico

也不起作用
QPlugin = QPluginLoader("qico4.dll")

这里提到了 How to include icons in application when using Pyinstaller 2.0 ,PySide 1.1.2 Bindings and Qt 4.8