Set icon on Qt application window and on executable
Sometimes, simple tasks like setting an icon for application or executable can be very confusing and complicated. In this tutorial, we will see how easy it is to set an icon for Qt applications.
A .ico file in the source directory. Icon can be any image of choice but it must be a .ico file for this to work.
Setup is very simple. The .ico file must in the source directory and one single line inside .pro file of the project:
RC_ICONS = my_icon.ico
After this run qmake, build the project, and run
. Now, the icon is set on the top left corner of the Qt application and also on our executable file.
If this was helpful, please share this blog and also feel free to add your thoughts or comments below.
Photo by Harpal Singh on Unsplash