From 07e9440b52d74e2b21b0b1df4bb959b553670452 Mon Sep 17 00:00:00 2001 From: Zhao Yuhang <2546789017@qq.com> Date: 周六, 06 1月 2024 21:06:40 +0800 Subject: [PATCH] update README --- src/quick/quickwindowagent.cpp | 45 +++++++++++++++++++++++++++++---------------- 1 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/quick/quickwindowagent.cpp b/src/quick/quickwindowagent.cpp index 77ccc9e..32ed68f 100644 --- a/src/quick/quickwindowagent.cpp +++ b/src/quick/quickwindowagent.cpp @@ -1,17 +1,28 @@ +// 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" #include <QtQuick/QQuickWindow> +#include <QtQuick/private/qquickanchors_p.h> #include "quickitemdelegate_p.h" namespace QWK { - QuickWindowAgentPrivate::QuickWindowAgentPrivate() { - } + /*! + \class QuickWindowAgent + \brief QuickWindowAgent is the window agent for QtQuick. - QuickWindowAgentPrivate::~QuickWindowAgentPrivate() { - } + 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; + + QuickWindowAgentPrivate::~QuickWindowAgentPrivate() = default; void QuickWindowAgentPrivate::init() { } @@ -20,8 +31,7 @@ : QuickWindowAgent(*new QuickWindowAgentPrivate(), parent) { } - QuickWindowAgent::~QuickWindowAgent() { - } + QuickWindowAgent::~QuickWindowAgent() = default; bool QuickWindowAgent::setup(QQuickWindow *window) { Q_ASSERT(window); @@ -34,10 +44,12 @@ return false; } - if (!d->setup(window, new QuickItemDelegate())) { - return true; - } + d->setup(window, new QuickItemDelegate()); d->hostWindow = window; + +#if defined(Q_OS_WINDOWS) && QWINDOWKIT_CONFIG(ENABLE_WINDOWS_SYSTEM_BORDERS) + d->setupWindows10BorderWorkaround(); +#endif return true; } @@ -51,6 +63,9 @@ if (!d->context->setTitleBar(item)) { return; } +#ifdef Q_OS_MAC + setSystemButtonArea(nullptr); +#endif Q_EMIT titleBarWidgetChanged(item); } @@ -72,19 +87,17 @@ return d->context->isHitTestVisible(item); } - void QuickWindowAgent::setHitTestVisible_item(const QQuickItem *item, bool visible) { + void QuickWindowAgent::setHitTestVisible(const QQuickItem *item, bool visible) { Q_D(QuickWindowAgent); d->context->setHitTestVisible(item, visible); } - void QuickWindowAgent::setHitTestVisible_rect(const QRect &rect, bool visible) { - Q_D(QuickWindowAgent); - d->context->setHitTestVisible(rect, visible); - } - + /*! + \internal + */ QuickWindowAgent::QuickWindowAgent(QuickWindowAgentPrivate &d, QObject *parent) : WindowAgentBase(d, parent) { d.init(); } -} +} \ No newline at end of file -- Gitblit v1.9.1