Window Icon Showing but TaskBar Icon not showing.
Unsolved
General and Desktop
-
I tried to set the TaskBar Icon in Windows using
IDI_ICON1 ICON DISCARDABLE "../images/icon.ico"
andapp.setWindowIcon()
but only window icon is showing not the taskbar icon. -
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
-
@Cobra91151
I am using cmake and added a rc file withIDI_ICON1 ICON DISCARDABLE "../images/icon.ico"
and added it to the CMake file. -
@Cobra91151
I am using cmake and added a rc file withIDI_ICON1 ICON DISCARDABLE "../images/icon.ico"
and added it to the CMake file.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.