Szpaqn
Szpaqn

Reputation: 595

How to set Task Bar icon depending on state of Qt app?

I would like to change the taskbar icon depending on the app state. (or just the colour of the icon).

In my main window i do setWindowIcon(ico);

I have found, that changing the window icon like above helps, but not when the program is installed in the Program Files.

When I use InnoSetup to install the app in Program Files, the icon does not change.

When I copy the .exe file to the Program Files location later or when I install in a different location (on a different drive), then Windows asks for some permission, and it works correctly. The app changes the icon.

Does any one know how to change the permissions for the app, so that it would change the icon? Or maybe something else is blocking the icon change?

When it comes to InnoSetup, I copy the files using the option Permissions: everyone-full like this:

Source: "path\to\file.exe"; DestDir: "{app}"; Flags: ignoreversion ; Permissions: everyone-full

I'm using Qt 5.7.1 with MSVC2015_64bit on Windows 10.

I have found this topics, but if copying the files work, than I do not think the users there are correct:

https://forum.qt.io/topic/11111/how-to-change-taskbar-icon-during-runtime-on-windows/6

https://forum.qt.io/topic/45324/taskbar-icon-different-from-the-icon-of-the-window

how to set an icon on a Main window and action with QT

Upvotes: 0

Views: 1120

Answers (1)

Brett Stottlemyer
Brett Stottlemyer

Reputation: 2852

I think you are looking for elements that are in Win-Extras module.

See the button and button progress classes.

Upvotes: 0

Related Questions