Platform: Win7 64-bit +QT Creator 3.6.1
1. First, to obtain an. ico format picture file, https://www.iconfinder.com/If you feel that you do not have the appropriate ICO image, you can get it from this website, maybe there are pictures you need. I downloaded a picture like this:
The picture gets placed under the project folder, can be placed in the project root directory, or can be placed under a sub-folder. I put it: Project root directory/res/myapp.ico, the red part is different depending on your project.
2. Create a new. rc file:
Right-click to add a new file
Select General->empty File
Enter the file name (the file name is Custom) and click Next
Click Finish
The following files will then be generated:
Enter the following in the newly created file:
Idi_icon1 ICON discardable "./res/myapp.ico"
The red part differs depending on the individual item.
3. Edit the. Pro file
Enter the following content:
Then recompile and run the program to see the effect.
Set QT app icon under Windows