From ab73edb5ba1aa60000c889ca6b349afeb566fde0 Mon Sep 17 00:00:00 2001 From: czyt1988 Date: Thu, 9 Nov 2023 23:54:52 +0800 Subject: [PATCH] #307 Fix the compilation error of qt6.x --- include/FramelessHelper/Core/framelesshelpercore_global.h | 2 +- src/core/utils_win.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/FramelessHelper/Core/framelesshelpercore_global.h b/include/FramelessHelper/Core/framelesshelpercore_global.h index 26eec15f..0786ef2e 100644 --- a/include/FramelessHelper/Core/framelesshelpercore_global.h +++ b/include/FramelessHelper/Core/framelesshelpercore_global.h @@ -116,7 +116,7 @@ QT_END_NAMESPACE #endif // QLatin1StringView can't be constexpr until Qt6? -#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +#if (QT_VERSION >= QT_VERSION_CHECK(6, 4, 0)) # define Q_STRING_CONSTEXPR constexpr #else # define Q_STRING_CONSTEXPR diff --git a/src/core/utils_win.cpp b/src/core/utils_win.cpp index 7008afdf..f5e46b69 100644 --- a/src/core/utils_win.cpp +++ b/src/core/utils_win.cpp @@ -49,9 +49,9 @@ # include # endif // (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) # include -# if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) +# if (QT_VERSION < QT_VERSION_CHECK(6, 2, 0)) # include -# else // (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +# else // (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) # include # endif // (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) #endif @@ -2305,7 +2305,7 @@ bool Utils::shouldAppsUseDarkMode_windows() return false; } #if FRAMELESSHELPER_CONFIG(private_qt) -# if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +# if (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) if (const auto app = qApp->nativeInterface()) { return app->isDarkMode(); } else { @@ -2320,7 +2320,7 @@ bool Utils::shouldAppsUseDarkMode_windows() # else // (QT_VERSION < QT_VERSION_CHECK(5, 15, 0)) // Qt gained the ability to detect the system dark mode setting only since 5.15. // We should detect it ourself on versions below that. -# endif // (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +# endif // (QT_VERSION >= QT_VERSION_CHECK(6, 2, 0)) #endif // FRAMELESSHELPER_CONFIG(private_qt) // Starting from Windows 10 1903, "ShouldAppsUseDarkMode()" (exported by UXTHEME.DLL, // ordinal number 132) always return "TRUE" (actually, a random non-zero number at