Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Setting the Application Icon
Forum Updated to NodeBB v4.3 + New Features

Setting the Application Icon

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ODБOïO Offline
    ODБOïO Offline
    ODБOï
    wrote on last edited by
    #1

    Hi,
    im trying to set an icon for my application.

    I tought i will simply create an icon, put it in my resources (qrc) and add RC_ICONS = myappico.ico in my .pro,
    but the doc say :
    However, if you already have an .rc file, for example, with the name myapp.rc, which you want to reuse, the following two steps will be required. First, put a single line of text to the myapp.rc file:

    i have a resources.rc + version.h files for version handling purposes,

    //resources.rc looks like this, and i dont know where to add the line

    IDI_ICON1 ICON "myappico.ico"

    #include <windows.h>
    #include "version.h"
    
    VS_VERSION_INFO VERSIONINFO
    FILEVERSION     VER_FILEVERSION
    PRODUCTVERSION  VER_PRODUCTVERSION
    
    BEGIN
        BLOCK "StringFileInfo"
        BEGIN
            BLOCK "040904E4"
            BEGIN
                VALUE "CompanyName",        VER_COMPANYNAME_STR
                VALUE "FileDescription",    VER_FILEDESCRIPTION_STR
                VALUE "FileVersion",        VER_FILEVERSION_STR
                VALUE "InternalName",       VER_INTERNALNAME_STR
                VALUE "LegalCopyright",     VER_LEGALCOPYRIGHT_STR
                VALUE "LegalTrademarks1",   VER_LEGALTRADEMARKS1_STR
                VALUE "LegalTrademarks2",   VER_LEGALTRADEMARKS2_STR
                VALUE "OriginalFilename",   VER_ORIGINALFILENAME_STR
                VALUE "ProductName",        VER_PRODUCTNAME_STR
                VALUE "ProductVersion",     VER_PRODUCTVERSION_STR
            END
        END
    
        BLOCK "VarFileInfo"
        BEGIN
            VALUE "Translation", 0x409, 1252
        END
    END
    
    
    1 Reply Last reply
    0
    • ODБOïO ODБOï

      This post is deleted!

      Gojir4G Offline
      Gojir4G Offline
      Gojir4
      wrote on last edited by Gojir4
      #3

      Hi @LeLev,

      Did you try to put your line at start of your existing rc file, after the includes ?
      It is defined as this in the Qt example projects like Qt Win Extras - Quick Player example or Active Qt Wrapper example

      ODБOïO 1 Reply Last reply
      3
      • ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on last edited by ODБOï
        #2
        This post is deleted!
        Gojir4G 1 Reply Last reply
        0
        • ODБOïO ODБOï

          This post is deleted!

          Gojir4G Offline
          Gojir4G Offline
          Gojir4
          wrote on last edited by Gojir4
          #3

          Hi @LeLev,

          Did you try to put your line at start of your existing rc file, after the includes ?
          It is defined as this in the Qt example projects like Qt Win Extras - Quick Player example or Active Qt Wrapper example

          ODБOïO 1 Reply Last reply
          3
          • Gojir4G Gojir4

            Hi @LeLev,

            Did you try to put your line at start of your existing rc file, after the includes ?
            It is defined as this in the Qt example projects like Qt Win Extras - Quick Player example or Active Qt Wrapper example

            ODБOïO Offline
            ODБOïO Offline
            ODБOï
            wrote on last edited by
            #4

            @Gojir4 hi
            Thank you so much!
            I did it before but it was underlined by Qt Creator and there was an error on that line saying :

            Semantic Issue : error unknown type name IDI_ICON1

            so hadn't even tried to compile.
            But it actually works.
            Thank you

            1 Reply Last reply
            2
            • Christian EhrlicherC Christian Ehrlicher referenced this topic on

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved