Detect dark/light mode changes to call update()
-
It seems that PyQt do not react by itself when the user modfies the desktops theme from a ligth to a dark one.
I need to catch that event to re-draw (via update()?) the whole GUI to fit to the new selected theme. But I don't get it how to do it.
@buhtz
Have you read through the suggestions at, say, https://stackoverflow.com/questions/75457687/detect-dark-application-style-theme-of-currently-used-desktop-in-qt ?Special handling if you are Qt 6.5+. Still may depend on your platform.For detecting the theme change event event, I am catching QEvent::ThemeChange in the main window's changeEvent() handler.
?
-
@buhtz
Have you read through the suggestions at, say, https://stackoverflow.com/questions/75457687/detect-dark-application-style-theme-of-currently-used-desktop-in-qt ?Special handling if you are Qt 6.5+. Still may depend on your platform.For detecting the theme change event event, I am catching QEvent::ThemeChange in the main window's changeEvent() handler.
?
Thanks. OK, there doesn't seem to be an easy way.
So I don't work on it and will suggest my users just to restart the application.
It is IMHO a rare case that users change the desktops color mode when the application is running. And even if it is the case most of them won't be bothered. -
Thanks. OK, there doesn't seem to be an easy way.
So I don't work on it and will suggest my users just to restart the application.
It is IMHO a rare case that users change the desktops color mode when the application is running. And even if it is the case most of them won't be bothered.