Reputation: 3081
In my Application i used pyside-rcc to generate qrc file
<RCC>
<qresource prefix="/" >
<file>images/icon.jpg</file>
</qresource>
</RCC>
using this command
pyside-rcc images.qrc -o images.py
then i imported it to my application
import images
and set the app icon
MainWindow.setWindowIcon(QtGui.QIcon(':/images/icon.jpg'))
when i run my application with python
python app.py
i can see the icon, nothing wrong with it
but when i compile it with pyinstaller
pyinstaller -i icon.co -w app.py
icon.co is only another file located in the main directory to set the exe icon.
the exe has an icon but when i open my application in the title or the head the icon images/icon.jpg
isn't loaded, also i don't see it in the toolbar.
I also tried to add Tree('path\to\images')
but it didn't work!
Upvotes: 0
Views: 2715
Reputation: 3081
It was very trivial .... just used .png
instead of .ico
or .jpg
to make it work.
this didn't also work for .ico
QPlugin = QPluginLoader("qico4.dll")
which was mentioned here How to include icons in application when using Pyinstaller 2.0 ,PySide 1.1.2 Bindings and Qt 4.8
Upvotes: 1