Results 1 to 4 of 4

Thread: How Set Icon To Exe File

  1. #1
    Join Date
    Oct 2011
    Posts
    36
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default How Set Icon To Exe File

    How I Set Icon To Exe File

    Please Example (No External URL)

    Thanks

  2. #2
    Join Date
    Oct 2007
    Location
    Lake Forest, CA, USA
    Posts
    132
    Thanks
    10
    Thanked 27 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: How Set Icon To Exe File

    Create resource file in Visual Studio and in your .pro file specify it:
    Qt Code:
    1. win32 {
    2. RC_FILE = icons/winicon.rc
    3. }
    To copy to clipboard, switch view to plain text mode 

    Here's .rc file sample from my project for you, if you do not want to use VS:
    Qt Code:
    1. // Microsoft Visual C++ generated resource script.
    2. //
    3.  
    4. #include "resource.h"
    5.  
    6. #define APSTUDIO_READONLY_SYMBOLS
    7. /////////////////////////////////////////////////////////////////////////////
    8. //
    9.  
    10. // Generated from the TEXTINCLUDE 2 resource.
    11. //
    12.  
    13. #include "afxres.h"
    14. /////////////////////////////////////////////////////////////////////////////
    15. #undef APSTUDIO_READONLY_SYMBOLS
    16.  
    17. /////////////////////////////////////////////////////////////////////////////
    18. // Russian resources
    19. #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
    20. #ifdef _WIN32
    21. LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
    22. #pragma code_page(1251)
    23. #endif //_WIN32
    24.  
    25. /////////////////////////////////////////////////////////////////////////////
    26. //
    27.  
    28. // Icon
    29. //
    30. // Icon with lowest ID value placed first to ensure application icon
    31. // remains consistent on all systems.
    32. IDI_ICON1 ICON "application.ico"
    33.  
    34. #ifdef APSTUDIO_INVOKED
    35. /////////////////////////////////////////////////////////////////////////////
    36. //
    37. // TEXTINCLUDE
    38. //
    39.  
    40. 1 TEXTINCLUDE
    41. BEGIN
    42. "resource.\0"
    43. END
    44.  
    45. 3 TEXTINCLUDE
    46. BEGIN
    47. "\r\0"
    48. END
    49.  
    50. #endif // APSTUDIO_INVOKED
    51.  
    52. /////////////////////////////////////////////////////////////////////////////
    53. //
    54. // Version
    55. //
    56.  
    57. VS_VERSION_INFO VERSIONINFO
    58.  
    59. FILEVERSION 1,1,0,0
    60. PRODUCTVERSION 1,1,0,0
    61. FILEFLAGSMASK 0x3fL
    62.  
    63. #ifdef _DEBUG
    64. FILEFLAGS 0x29L
    65. #else
    66. FILEFLAGS 0x28L
    67. #endif
    68.  
    69. FILEOS 0x4L
    70. FILETYPE 0x1L
    71. FILESUBTYPE 0x0L
    72.  
    73. BEGIN
    74. BLOCK "StringFileInfo"
    75. BEGIN
    76. BLOCK "000904b0"
    77. BEGIN
    78. VALUE "Comments", "Application"
    79. VALUE "CompanyName", "Company"
    80. VALUE "FileDescription", "Application"
    81. VALUE "FileVersion", "1, 1, 0, 0"
    82. VALUE "InternalName", "application"
    83. VALUE "LegalCopyright", "Copyright © 2011 Company"
    84. VALUE "OriginalFilename", "application"
    85. VALUE "PrivateBuild", "0"
    86. VALUE "ProductName", "Application"
    87. VALUE "ProductVersion", "1, 1, 0, 0"
    88. VALUE "SpecialBuild", "0"
    89. END
    90. END
    91.  
    92. BLOCK "VarFileInfo"
    93. BEGIN
    94. VALUE "Translation", 0x9, 1200
    95. END
    96. END
    97. #endif // Russian resources
    98.  
    99. /////////////////////////////////////////////////////////////////////////////
    100.  
    101. #ifndef APSTUDIO_INVOKED
    102. /////////////////////////////////////////////////////////////////////////////
    103. //
    104. // Generated from the TEXTINCLUDE 3 resource.
    105. //
    106. /////////////////////////////////////////////////////////////////////////////
    107. #endif // not APSTUDIO_INVOKED
    To copy to clipboard, switch view to plain text mode 

    resource.h:
    Qt Code:
    1. //{{NO_DEPENDENCIES}}
    2. // Microsoft Visual C++ generated include file.
    3. // Used by winicon.rc
    4. //
    5.  
    6. // Next default values for new objects
    7. //
    8.  
    9. #ifdef APSTUDIO_INVOKED
    10.  
    11. #ifndef APSTUDIO_READONLY_SYMBOLS
    12. #define _APS_NEXT_RESOURCE_VALUE 101
    13. #define _APS_NEXT_COMMAND_VALUE 40001
    14. #define _APS_NEXT_CONTROL_VALUE 1000
    15. #define _APS_NEXT_SYMED_VALUE 101
    16. #endif
    17.  
    18. #endif
    To copy to clipboard, switch view to plain text mode 
    Last edited by Oleg; 20th November 2011 at 13:57.
    Oleg Shparber

  3. #3
    Join Date
    Oct 2011
    Posts
    36
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How Set Icon To Exe File

    Very Thanks
    Mr.Oleg

    Your Solution is Best

  4. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How Set Icon To Exe File

    This is in the Qt docs: Setting the Application Icon for the major desktop operating systems and Symbian.

Similar Threads

  1. Replies: 0
    Last Post: 17th March 2010, 13:25
  2. How to get system associated icon for any file
    By rittchat in forum Qt Programming
    Replies: 0
    Last Post: 15th December 2009, 04:16
  3. Save Icon in a file
    By prashant in forum Qt Programming
    Replies: 1
    Last Post: 27th November 2009, 18:07
  4. How to get a file's icon
    By sophister in forum Qt Programming
    Replies: 2
    Last Post: 24th April 2009, 17:22
  5. set Icon to .app file
    By vishal.chauhan in forum Qt Programming
    Replies: 2
    Last Post: 10th January 2007, 21:13

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.