HowTo set Icon to Qt Application, created with Qt Visual Studio Add-in?

Posted by mosg on Stack Overflow See other posts from Stack Overflow or by mosg
Published on 2010-06-01T11:18:25Z Indexed on 2010/06/02 19:24 UTC
Read the original article Hit count: 447

Filed under:
|
|

Hello.

Here is what I have:

  • Visual Studio 2008 (on 32-bit Windows XP)
  • Qt libraries 4.6.2 for Windows (VS 2008, 194 MB)
  • Visual Studio Add-in (44 MB)

After I installed all the software, I created simple Qt Application project, with Visual Studio: menu File | New | Project... and Qt4 Projects | Qt Application.

Build it, and here is the question: how to set application icon to my compiled exe file? I need to see specified ICO in explorer!


Old method with MyProject.pro not interested!!!

  1. Create a .ico file with both 16x16 and 32x32-pixel versions of the icon (you can do this in Visual Studio).

  2. Create a .rc file containing the following text:

    IDI_ICON1 ICON DISCARDABLE "myIcon.ico"

  3. Add the following to your .pro file

    RC_FILE = myFile.rc

  4. Run qmake.

Thanks.

© Stack Overflow or respective owner

Related posts about qt

Related posts about qt4