{
if (!_paletteSignalsConnected) {
if (const auto ptr = qobject_cast<QGuiApplication *>(QGuiApplication::instance())) {
- connect(ptr, &QGuiApplication::paletteChanged, this, &Theme::systemPaletteChanged);
- connect(ptr->styleHints(), &QStyleHints::colorSchemeChanged, this, &Theme::darkModeChanged);
+#ifdef Q_OS_WIN
+ // Windows 10 does not have proper dark mode support via Qt 6 so hack detection
+ if (!IsWindows11OrGreater()) {
+ connect(ptr, &QGuiApplication::paletteChanged, this, &Theme::darkModeChanged);
+ } else
+#endif
+ {
+ connect(ptr->styleHints(), &QStyleHints::colorSchemeChanged, this, &Theme::darkModeChanged);
+ }
_paletteSignalsConnected = true;
}
}