From 6eb2efea00eb07ce3a6b089b984885ce4a08c9ca Mon Sep 17 00:00:00 2001 From: Sine Striker <trueful@163.com> Date: 周五, 29 12月 2023 20:55:09 +0800 Subject: [PATCH] Add WinRegKey support --- src/quick/quickwindowagent.cpp | 41 +++++++++++++++++++++++++---------------- 1 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/quick/quickwindowagent.cpp b/src/quick/quickwindowagent.cpp index 77ccc9e..3cecb21 100644 --- a/src/quick/quickwindowagent.cpp +++ b/src/quick/quickwindowagent.cpp @@ -2,16 +2,23 @@ #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 +27,7 @@ : QuickWindowAgent(*new QuickWindowAgentPrivate(), parent) { } - QuickWindowAgent::~QuickWindowAgent() { - } + QuickWindowAgent::~QuickWindowAgent() = default; bool QuickWindowAgent::setup(QQuickWindow *window) { Q_ASSERT(window); @@ -34,10 +40,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 +59,9 @@ if (!d->context->setTitleBar(item)) { return; } +#ifdef Q_OS_MAC + setSystemButtonArea(nullptr); +#endif Q_EMIT titleBarWidgetChanged(item); } @@ -72,19 +83,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