How to Update Your Qt Application’s Taskbar Icon at Runtime

To update a Qt app’s taskbar icon you need to create a QIcon object and assign it using setWindowIcon of the QApplication. Here is very simple example:

qApp->setWindowIcon(QIcon("path-to-an-image-file"));

Notice that you are not required to provide an icon file (*.ico , *.icns etc.) for this function to work and you can use any (standard) image file type such as *.jpg or *.png etc. This function can be called anywhere in the program. You can use this same method along with a QTimer to ANIMATE TASKBAR ICON.

Shell Overlay Icons Problem Fix

Having many programs with Shell Overlay Icons in Windows will cause some of them to not appear. This is because there is a limit to how many Shell Overlay Icons. (Not sure but I think it’s around 10 icons)

Below is an example of a Shell Overlay Icon.

shelloverlayiconexample

To overcome this problem you need to run “regedit” and edit the registry entries in the path below:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\ShellIconOverlayIdentifiers

Just delete any entries you don’t need and restart.