diff --git a/include/FramelessHelper/Core/framelesshelpercore_global.h b/include/FramelessHelper/Core/framelesshelpercore_global.h index fcfa598d..c3e3d666 100644 --- a/include/FramelessHelper/Core/framelesshelpercore_global.h +++ b/include/FramelessHelper/Core/framelesshelpercore_global.h @@ -100,6 +100,13 @@ QT_END_NAMESPACE using QT_ENTER_EVENT_TYPE = QEvent; #endif +// QLatin1StringView can't be constexpr until Qt6? +#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)) +# define Q_STRING_CONSTEXPR constexpr +#else +# define Q_STRING_CONSTEXPR +#endif + #ifndef QUtf8String # define QUtf8String(str) QString::fromUtf8(str) #endif @@ -167,7 +174,7 @@ QT_END_NAMESPACE #ifndef FRAMELESSHELPER_STRING_CONSTANT2 # define FRAMELESSHELPER_STRING_CONSTANT2(name, str) \ - [[maybe_unused]] static constexpr const auto k##name = FRAMELESSHELPER_STRING(str); + [[maybe_unused]] static Q_STRING_CONSTEXPR const auto k##name = FRAMELESSHELPER_STRING(str); #endif #ifndef FRAMELESSHELPER_BYTEARRAY_CONSTANT diff --git a/src/core/framelesshelper_win.cpp b/src/core/framelesshelper_win.cpp index 71ed3414..0e488cc1 100644 --- a/src/core/framelesshelper_win.cpp +++ b/src/core/framelesshelper_win.cpp @@ -648,7 +648,7 @@ bool FramelessHelperWin::nativeEventFilter(const QByteArray &eventType, void *me const LPARAM lParam = msg->lParam; #if (QT_VERSION < QT_VERSION_CHECK(6, 5, 1)) - const auto updateRestoreGeometry = [windowId, &data](const bool ignoreWindowState) -> void { + const auto updateRestoreGeometry = [windowId, &muData](const bool ignoreWindowState) -> void { if (!ignoreWindowState && !Utils::isWindowNoState(windowId)) { return; }