Answer the question
In order to leave comments, you need to log in
How to correctly change the application tray icon?
There is a class that generates a tray icon, inherited from QSystemTrayIcon. An object of this class is created in Main, we get a tray icon, everything is ok. But when you need to change the image by changing the state in objects of other classes, you have to pass an icon object to them in order to change them there. And when there are many such classes, then there is a strong connection and everywhere you have to pass this object. How to more competently implement changing the tray icon on events inside other classes?
Answer the question
In order to leave comments, you need to log in
You can use the "Observer" pattern: https://refactoring.guru/en/design-patterns/observ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question