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.