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. Set exe icon from qrc using Visual Studio

Set exe icon from qrc using Visual Studio

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 6.2k 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.
  • QT-static-prgmQ Offline
    QT-static-prgmQ Offline
    QT-static-prgm
    wrote on last edited by
    #1

    Hi,

    i know there is a easy way to set the application icon from qrc using QtCreator. But i'm working on Visual Studio using the Qt Addon. Does anyone knows how it works that way??

    1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      qrc is Qt's resource format. The data is translated into static c++ binary array. OS knows nothing about this mechanism so it's not true you can set it up in Qt Creator. You're probably thinking about the qmake's RC_ICONS, but that has nothing to do with Qt's qrc resources. It's just a platform independent shortcut for whatever needs to be done.

      On Windows, particularly in Visual Studio, "what needs to be done" means creating a whatevername.rc file, adding it to the solution, inserting a line similar to this into it (adjust the file name of course):

      IDI_ICON1               ICON    DISCARDABLE     "myappico.ico"
      

      and compile it. You can also use the "right click on the project node->add->resource->icon" wizard, but be aware that it somewhat bloats the resource file, when all you need is the above line.

      Oh, and be sure to check the docs for more info: Setting the Application Icon.

      QT-static-prgmQ 1 Reply Last reply
      3
      • Chris KawaC Chris Kawa

        qrc is Qt's resource format. The data is translated into static c++ binary array. OS knows nothing about this mechanism so it's not true you can set it up in Qt Creator. You're probably thinking about the qmake's RC_ICONS, but that has nothing to do with Qt's qrc resources. It's just a platform independent shortcut for whatever needs to be done.

        On Windows, particularly in Visual Studio, "what needs to be done" means creating a whatevername.rc file, adding it to the solution, inserting a line similar to this into it (adjust the file name of course):

        IDI_ICON1               ICON    DISCARDABLE     "myappico.ico"
        

        and compile it. You can also use the "right click on the project node->add->resource->icon" wizard, but be aware that it somewhat bloats the resource file, when all you need is the above line.

        Oh, and be sure to check the docs for more info: Setting the Application Icon.

        QT-static-prgmQ Offline
        QT-static-prgmQ Offline
        QT-static-prgm
        wrote on last edited by
        #3

        @Chris-Kawa thank you :D

        1 Reply Last reply
        0

        • Login

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