Solved executable file icon is black
-
I' following https://doc.qt.io/qt-5/appicon.html instuctions to set an icon for my application.
~~![0_1533150876912_test2.ico](Uploading 100%)
this is a downloaded icon that I test with.~~
seems not able to upload for some reason, I download it from http://www.iconarchive.com/tag/ico-files
The icon shows perfectly on my application window. But the generated exe file has a all black icon like this:
I tried several icon files, with no luck. Is there a specific layer of .ico file that qt need to render to the exe file?
update: this happens in release mode, while in debug mode, exe file icon shows correctly. But why?
Thanks for help
-
@mondo
The .ico file is in your application's source code directory?
Which platform are you on? -
@Ratzz yes it is in my source directory. Since the icon shows on application window, and works in debug mode, I think the path should be correct.
I'm working with qt 5.11.1 /Qtcreator 4.7 /msvc2015 32bit compiler on windows10.
I did a few research, and feel it might be an issue with windows icon cache, still trying.
-
Can you try deleting the output directory completely and rebuild?
https://forum.qt.io/topic/53253/set-icon-of-my-exe-file/4 -
@Ratzz upload fails for some reason.
http://www.iconarchive.com/download/i103934/sora-meliae/matrilineare/Mimes-image-x-ico.ico
this is the link of the ico file, should be fast to download.
Thanks a lot -
@mondo said in executable file icon is black:
this is the link of the ico file, should be fast to download.
Proxy is blocked so could not download it. Can you try with this ?
-
@Ratzz https://expirebox.com/download/60a98bfef540ff16e37caf896f62e384.html
This is a nice tool! -
@mondo
With your .ico icon sets fine in both release and debug mode. Also executable icon is set in both release and debug mode.
-
@Ratzz
Ahh, finally.
After cleaning the icon cache, and a reboot, the icon appears at last.Riduculous windows system, I hate it.
Anyways, thanks for your help mate.