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. Window Icon Showing but TaskBar Icon not showing.
Forum Updated to NodeBB v4.3 + New Features

Window Icon Showing but TaskBar Icon not showing.

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 2 Posters 1.6k 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.
  • A Offline
    A Offline
    animeshdhakal
    wrote on last edited by
    #1

    I tried to set the TaskBar Icon in Windows using IDI_ICON1 ICON DISCARDABLE "../images/icon.ico" and app.setWindowIcon() but only window icon is showing not the taskbar icon.

    alt text

    alt text

    1 Reply Last reply
    0
    • Cobra91151C Offline
      Cobra91151C Offline
      Cobra91151
      wrote on last edited by Cobra91151
      #2

      Hello!

      Have you tried to set your icon to .pro file? Check out the code below:

      .pro

      RC_ICONS += some_icon.ico
      

      More details here: https://doc.qt.io/qt-6/appicon.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        animeshdhakal
        wrote on last edited by animeshdhakal
        #3

        @Cobra91151
        I am using cmake and added a rc file with IDI_ICON1 ICON DISCARDABLE "../images/icon.ico" and added it to the CMake file.

        Cobra91151C 1 Reply Last reply
        0
        • A animeshdhakal

          @Cobra91151
          I am using cmake and added a rc file with IDI_ICON1 ICON DISCARDABLE "../images/icon.ico" and added it to the CMake file.

          Cobra91151C Offline
          Cobra91151C Offline
          Cobra91151
          wrote on last edited by Cobra91151
          #4

          @animeshdhakal

          So, in case of cmake (https://doc.qt.io/qt-6/appicon.html):

          Using CMake on Windows
          To configure your application's icon, a resource file containing information about the icon is required. A resource file is a text file that contains information about the application resources, such as icons, cursors, fonts, and so on. For more information about resource files and what it can contain, see About Resource Files.
          
          Once you have the .rc file, add information about the ICO file to it and use it to configure your application icon.
          
          The following snippet demonstrates how the Qt Quick Demo - Photo Surface example application uses CMake to set up an application icon:
          
              set(app_icon_resource_windows "${CMAKE_CURRENT_SOURCE_DIR}/resources/photosurface.rc")
              qt_add_executable(photosurface main.cpp ${app_icon_resource_windows})
          Notice that the set command, defines the app_icon_windows variable, which contains the path of the RC file. This variable is used with the add_executable command to set the application's icon.
          

          Also, I suggest you check out the icon's path in your .rc file, it could be invalid.

          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