Answer the question
In order to leave comments, you need to log in
How to add an icon to an exe in qt5 that would not be in the folder?
When I run it with an icon in the folder, it works, but when I remove the icon from the folder, there are no icons!
app_icon = QtGui.QIcon()
app_icon.addFile('1.ico', QtCore.QSize(16,16))
app_icon.addFile('3.ico', QtCore.QSize(24,24))
app_icon.addFile('4.ico', QtCore.QSize(32,32))
app_icon.addFile('5.ico', QtCore.QSize(48,48))
app_icon.addFile('10.ico', QtCore.QSize(118,118))
Dialog.setWindowIcon(app_icon)
pyinstaller --onefile --icon=1.ico -w outputpyfile.py
Answer the question
In order to leave comments, you need to log in
Using the environment variable _MEIPASS will save the poor cat from starvation. I have answered questions like this many times here. Whether you added an icon to the "distribution", I don't know. One, maybe, but obviously not all.
PS Read
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question