1

I have successfully changed the icon in my window's left up corner using the .rc file. However, the icon in the windows' file system remain the same as before. How could I change that too?

Nejat
  • 31,784
  • 12
  • 106
  • 138
Nyaruko
  • 4,329
  • 9
  • 54
  • 105

2 Answers2

4

In Qt 4, you need to create a .rc file like this:

IDI_ICON1 ICON DISCARDABLE "myIcon.ico"

You should add this to your .pro file :

win32: RC_FILE += MyApp.rc

In Qt 5 there is an automated process for setting an icon to the application executable file .

You can just add the following to the .pro file:

win32: RC_ICONS = myIcon.ico

Also store the .ico file in your application's source code directory.

Nejat
  • 31,784
  • 12
  • 106
  • 138
1

Please not that only that top left corner of the window icon is controlled by Qt: http://qt-project.org/doc/qt-4.8/appicon.html#notes

The executable icon isn't a GUI element so it really has nothing to do with Qt. It can be embedded in the executable by visual studio though: How do I set the icon for my application in visual studio 2008?

Community
  • 1
  • 1
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288