Whenever I run the script of my app or the compiled exe, the icon doesn't show in the taskbar on Windows. When I run my script in Pycharm on Linux, the icon shows just fine.
Here's how I'm adding the icon in my script:
app.setWindowIcon(QIcon("images/images/icon.ico"))
And here's how I'm adding the icon to the spec file compiled with PyInstaller:
icon=['icon.ico']
I tried using a QPixmap and I got the same result. I also tried having the icon in the same folder as my main.py file, but to no avail.
Update:
I was first using PySide2, now I migrated to PySide6. I'm now compiling and developing on Windows 10. I followed all the solutions in this SO question. When I don't add the AppUserModelID, the taskbar icon doesn't even appear when running the app from my IDE. When I do, it does show. However, after compilation, it does not.
I tried using a PNG, I tried a 32x32 icon, 48x48, nothing. I ran my .exe on another machine, still not appearing.
UPDATE:
Only thing that worked for me after days of trial and error is the answer from Saren Tasciyan on this question and Nuno André's rendition.