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. How to have a custom icon for my application.exe/executable QT, i used Visual Studio 2019
QtWS25 Last Chance

How to have a custom icon for my application.exe/executable QT, i used Visual Studio 2019

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 645 Views
  • 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.
  • L Offline
    L Offline
    learnist
    wrote on last edited by
    #1

    I wanted to have a custom icon for my application.exe executable , i have also tried referring this documentation https://doc.qt.io/qt-5/appicon.html, but i didn't use QT-Creator to create my project,so i don't have the .pro file to make any changes, i have used Visual Studio 2019 to work on my project and complete it.

    How can i set a custom icon when i used Visual studio 2019 ?

    1 Reply Last reply
    0
    • Christian EhrlicherC Offline
      Christian EhrlicherC Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @learnist said in How to have a custom icon for my application.exe/executable QT, i used Visual Studio 2019:

      ut i didn't use QT-Creator to create my project,

      So what do you actually use?
      You have to create a .rc file - no matter what build system you're using. See e.g. here: https://forum.qt.io/topic/81519/how-to-set-the-application-icon-on-windows-using-cmake

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      L 1 Reply Last reply
      1
      • Christian EhrlicherC Christian Ehrlicher

        @learnist said in How to have a custom icon for my application.exe/executable QT, i used Visual Studio 2019:

        ut i didn't use QT-Creator to create my project,

        So what do you actually use?
        You have to create a .rc file - no matter what build system you're using. See e.g. here: https://forum.qt.io/topic/81519/how-to-set-the-application-icon-on-windows-using-cmake

        L Offline
        L Offline
        learnist
        wrote on last edited by
        #3

        @Christian-Ehrlicher i can definately create a .rc file but how to add it in pro file, i dont have .pro , right ?
        341b0a62-ddc3-49b6-a35e-e7232f54babe-image.png

        1 Reply Last reply
        0
        • Christian EhrlicherC Offline
          Christian EhrlicherC Offline
          Christian Ehrlicher
          Lifetime Qt Champion
          wrote on last edited by
          #4

          If you don't use a pro file or CMake script you have to add it by your own similar you're calling e.g. uic or moc - see the msdn documentation.

          Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
          Visit the Qt Academy at https://academy.qt.io/catalog

          1 Reply Last reply
          1
          • S Offline
            S Offline
            SimonSchroeder
            wrote on last edited by
            #5

            Actually, this question is not Qt-related. It works for Qt as for any other software not using Qt. I, personally, don't know how to setup VS2019 properly to do this. What you could try, though, is to make a small dummy qmake project, set RC_ICON appropriately, compile it and have a look at the makefile. If your .pro-file has TARGET=MyProject, qmake will generate a MyProject_resource.rc. This needs to be compiled with Visual Studios rc resulting in a .res-file. I guess, this is then just linked in. At least this is the way qmake does it and you can take the steps from its makefile.

            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