QWindowKit  1.5.1.0
Cross-platform window customization framework
Loading...
Searching...
No Matches
quickwindowagent_p.h
1// Copyright (C) 2023-present Stdware Collections (https://www.github.com/stdware)
2// Copyright (C) 2021-2023 wangwenx190 (Yuhang Zhao)
3// SPDX-License-Identifier: Apache-2.0
4
5#ifndef QUICKWINDOWAGENTPRIVATE_H
6#define QUICKWINDOWAGENTPRIVATE_H
7
8//
9// W A R N I N G !!!
10// -----------------
11//
12// This file is not part of the QWindowKit API. It is used purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or may even be removed.
15//
16
17#include <QPointer>
18
19#include <QWKCore/qwkconfig.h>
20#include <QWKCore/private/windowagentbase_p.h>
21#include <QWKQuick/quickwindowagent.h>
22
23namespace QWK {
24
25 class QuickWindowAgentPrivate : public WindowAgentBasePrivate {
26 Q_DECLARE_PUBLIC(QuickWindowAgent)
27 public:
28 QuickWindowAgentPrivate();
29 ~QuickWindowAgentPrivate() override;
30
31 void init();
32
33 // Host
34 QQuickWindow *hostWindow{};
35
36#ifdef Q_OS_MAC
37 QQuickItem *systemButtonAreaItem{};
38 std::unique_ptr<QObject> systemButtonAreaItemHandler;
39#endif
40
41#if defined(Q_OS_WINDOWS) && QWINDOWKIT_CONFIG(ENABLE_WINDOWS_SYSTEM_BORDERS)
42 void setupWindows10BorderWorkaround();
43
44 // The Win10 border workaround item is reparented into the host
45 // window's content item and holds a raw context pointer; it must be
46 // tracked and destroyed together with the agent (strictly before the
47 // context unique_ptr), or the window teardown dereferences freed
48 // memory through BorderItem::itemChange().
49 QPointer<QQuickItem> win10BorderItem{};
50#endif
51 };
52
53}
54
55#endif // QUICKWINDOWAGENTPRIVATE_H
QWindowKit namespace.
Definition abstractwindowcontext.cpp:13