From e5c3837218c3dc2b7b327f11de5894b9350adbc9 Mon Sep 17 00:00:00 2001
From: SineStriker <55847490+SineStriker@users.noreply.github.com>
Date: 摹曛, 30 5月 2024 19:54:59 +0800
Subject: [PATCH] Merge pull request #94 from mentalfl0w/patch-2

---
 src/quick/quickwindowagent.cpp |   35 +++++++++++++++++++++++++++++------
 1 files changed, 29 insertions(+), 6 deletions(-)

diff --git a/src/quick/quickwindowagent.cpp b/src/quick/quickwindowagent.cpp
index 2657126..a9bfd84 100644
--- a/src/quick/quickwindowagent.cpp
+++ b/src/quick/quickwindowagent.cpp
@@ -1,3 +1,7 @@
+// Copyright (C) 2023-2024 Stdware Collections (https://www.github.com/stdware)
+// Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao)
+// SPDX-License-Identifier: Apache-2.0
+
 #include "quickwindowagent.h"
 #include "quickwindowagent_p.h"
 
@@ -7,6 +11,14 @@
 #include "quickitemdelegate_p.h"
 
 namespace QWK {
+
+    /*!
+        \class QuickWindowAgent
+        \brief QuickWindowAgent is the window agent for QtQuick.
+
+        It provides interfaces for QtQuick and processes some Qt events related to the QQuickItem
+        instance. The usage of all APIs is consistent with the \a Widgets module.
+    */
 
     QuickWindowAgentPrivate::QuickWindowAgentPrivate() = default;
 
@@ -32,12 +44,10 @@
             return false;
         }
 
-        if (!d->setup(window, new QuickItemDelegate())) {
-            return false;
-        }
+        d->setup(window, new QuickItemDelegate());
         d->hostWindow = window;
 
-#ifdef Q_OS_WINDOWS
+#if defined(Q_OS_WINDOWS) && QWINDOWKIT_CONFIG(ENABLE_WINDOWS_SYSTEM_BORDERS)
         d->setupWindows10BorderWorkaround();
 #endif
         return true;
@@ -53,6 +63,9 @@
         if (!d->context->setTitleBar(item)) {
             return;
         }
+#ifdef Q_OS_MAC
+        setSystemButtonArea(nullptr);
+#endif
         Q_EMIT titleBarWidgetChanged(item);
     }
 
@@ -69,19 +82,29 @@
         Q_EMIT systemButtonChanged(button, item);
     }
 
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
+    bool QuickWindowAgent::isHitTestVisible(QQuickItem *item) const {
+#else
     bool QuickWindowAgent::isHitTestVisible(const QQuickItem *item) const {
+#endif
         Q_D(const QuickWindowAgent);
         return d->context->isHitTestVisible(item);
     }
-
+#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
+    void QuickWindowAgent::setHitTestVisible(QQuickItem *item, bool visible) {
+#else
     void QuickWindowAgent::setHitTestVisible(const QQuickItem *item, bool visible) {
+#endif
         Q_D(QuickWindowAgent);
         d->context->setHitTestVisible(item, visible);
     }
 
+    /*!
+        \internal
+    */
     QuickWindowAgent::QuickWindowAgent(QuickWindowAgentPrivate &d, QObject *parent)
         : WindowAgentBase(d, parent) {
         d.init();
     }
 
-}
\ No newline at end of file
+}

--
Gitblit v1.9.1