-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Closed
Description
The qt_mac_applicationIsInDarkMode
function
bool qt_mac_applicationIsInDarkMode()
{
#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14)
if (__builtin_available(macOS 10.14, *)) {
auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames:
@[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]];
return [appearance isEqualToString:NSAppearanceNameDarkAqua];
}
#endif
return false;
}
behavior depends on the compiler that was used for static build.
It returns true
or false
depending on OS appearance setting on old compilers:
- apple clang 10.0.1 on macOS Mojave 10.14.6 (18G8022)
- llvm clang 8.0.0 used in depends
It always returns false
on newer compilers:
- apple clang 12.0.0 on macOS Catalina 10.15.7 (19H524) and Big Sur 11.2.3 (20D91)
- llvm clang 10.0.1 in depends, see build: macOS toolchain bump #19817 (comment)