Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
fix qt5 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Jul 29, 2023
1 parent 2f7a104 commit 1b4b5b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion include/FramelessHelper/Core/framelesshelpercore_global.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/framelesshelper_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1b4b5b6

Please sign in to comment.