How to react to light/dark mode changes in macos?
Unsolved
General and Desktop
-
Hi,
Because, AFAIK, there's currently nothing specific for that available. You should check the macOS API to see if there's an event or equivalent that you can catch.
-
Have you found a solution?
-
I think the only thing you can rely on is QPalette colors.
for example the window background color:
palette().color(QPalette::Window);
returns:
QColor(ARGB 1, 0.196078, 0.196078, 0.196078) for dark mode
QColor(ARGB 1, 0.92549, 0.92549, 0.92549) for light mode -
a swift (hehe) google search resulted in this so topic
https://stackoverflow.com/a/52406553/15422846
its objective c, so you should be able to include it in your c++ project