From a4d0b98d40d0f740742e393db774ee53302ec64c Mon Sep 17 00:00:00 2001 From: Zhao Yuhang <2546789017@qq.com> Date: 周五, 30 5月 2025 16:11:16 +0800 Subject: [PATCH] minor tweaks --- src/core/contexts/cocoawindowcontext.mm | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/src/core/contexts/cocoawindowcontext.mm b/src/core/contexts/cocoawindowcontext.mm index 28738c6..dbf260e 100644 --- a/src/core/contexts/cocoawindowcontext.mm +++ b/src/core/contexts/cocoawindowcontext.mm @@ -745,7 +745,11 @@ Q_ASSERT(m_windowId); if (key == QStringLiteral("no-system-buttons")) { +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) if (attribute.type() != QVariant::Bool) +#else + if (attribute.typeId() != QMetaType::Type::Bool) +#endif return false; ensureWindowProxy(m_windowId)->setSystemButtonVisible(!attribute.toBool()); return true; @@ -753,14 +757,22 @@ if (key == QStringLiteral("blur-effect")) { auto mode = NSWindowProxy::BlurMode::None; +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) if (attribute.type() == QVariant::Bool) { +#else + if (attribute.typeId() == QMetaType::Type::Bool) { +#endif if (attribute.toBool()) { NSString *osxMode = [[NSUserDefaults standardUserDefaults] stringForKey:@"AppleInterfaceStyle"]; mode = [osxMode isEqualToString:@"Dark"] ? NSWindowProxy::BlurMode::Dark : NSWindowProxy::BlurMode::Light; } +#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)) } else if (attribute.type() == QVariant::String) { +#else + } else if (attribute.typeId() == QMetaType::Type::QString) { +#endif auto value = attribute.toString(); if (value == QStringLiteral("dark")) { mode = NSWindowProxy::BlurMode::Dark; -- Gitblit v1.9.1