setWindowIcon doesn't work after create shorcut qt6
-
Hi, I want to change the icon in the taskbar depending on the application state, it works normal when i just build and run app, but after installing and creating a shortcut, it doesn’t work. Found a little trick - after pin/unpin at taskbar, icon changes normally, can anyone help me for work without this trick?(it's not easy task pin/unpin programatically)) I'm using QT6.5.1, function setWindowIcon(QIcon). Windows 11
-
Hi, I want to change the icon in the taskbar depending on the application state, it works normal when i just build and run app, but after installing and creating a shortcut, it doesn’t work. Found a little trick - after pin/unpin at taskbar, icon changes normally, can anyone help me for work without this trick?(it's not easy task pin/unpin programatically)) I'm using QT6.5.1, function setWindowIcon(QIcon). Windows 11
@Anton-Beresnev
Please show a minimal reproducing example. -
@Anton-Beresnev
Please show a minimal reproducing example.@Axel-Spoerl sorry for late answer https://github.com/aberesnev2009/IconChanging after building, create shortcut to .exe and place to desktop. icon at Taskbar doesn't change, there are 2 possible solution:
- delete shortcut, all works fine.
- when exe started, pin and then unpin at taskbar and all works fine
-
@Axel-Spoerl sorry for late answer https://github.com/aberesnev2009/IconChanging after building, create shortcut to .exe and place to desktop. icon at Taskbar doesn't change, there are 2 possible solution:
- delete shortcut, all works fine.
- when exe started, pin and then unpin at taskbar and all works fine
A shortcut has nothing to do with the application - it's using it's own copy of an icon and does not look at any executable so your observation is correct but can't be changed by Qt. A shortcut can even live without the link destination still exists.
-
A shortcut has nothing to do with the application - it's using it's own copy of an icon and does not look at any executable so your observation is correct but can't be changed by Qt. A shortcut can even live without the link destination still exists.
@Christian-Ehrlicher it's sad) I hope QT developers can improve it by any way) I try to use windows API lib's for automatic pin/unpin to taskbars, but Microsoft locked this methods)
-
@Christian-Ehrlicher it's sad) I hope QT developers can improve it by any way) I try to use windows API lib's for automatic pin/unpin to taskbars, but Microsoft locked this methods)
@Anton-Beresnev said in setWindowIcon doesn't work after create shorcut qt6:
I hope QT developers can improve it by any way
I don't understand what Qt has to do with windows shortcuts...