QWindowKit  1.5.1.0
Cross-platform window customization framework
Loading...
Searching...
No Matches
quickwindowagent.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 QUICKWINDOWAGENT_H
6#define QUICKWINDOWAGENT_H
7
8#include <QtQuick/QQuickItem>
9#include <QtQuick/QQuickWindow>
10
11#include <QWKCore/windowagentbase.h>
12#include <QWKQuick/qwkquickglobal.h>
13
14namespace QWK {
15
16 class QuickWindowAgentPrivate;
17
18 class QWK_QUICK_EXPORT QuickWindowAgent : public WindowAgentBase {
19 Q_OBJECT
20 Q_DECLARE_PRIVATE(QuickWindowAgent)
21 public:
22 explicit QuickWindowAgent(QObject *parent = nullptr);
23 ~QuickWindowAgent() override;
24
25 public:
26 Q_INVOKABLE bool setup(QQuickWindow *window);
27
28 Q_INVOKABLE QQuickItem *titleBar() const;
29 Q_INVOKABLE void setTitleBar(QQuickItem *item);
30
31 Q_INVOKABLE QQuickItem *systemButton(SystemButton button) const;
32 Q_INVOKABLE void setSystemButton(SystemButton button, QQuickItem *item);
33
34#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
35 Q_INVOKABLE bool isHitTestVisible(QQuickItem *item) const;
36#else
37 Q_INVOKABLE bool isHitTestVisible(const QQuickItem *item) const;
38#endif
39 Q_INVOKABLE void setHitTestVisible(QQuickItem *item, bool visible = true);
40
41#ifdef Q_OS_MAC
42 // The system button area APIs are experimental, very likely to change in the future.
43 Q_INVOKABLE QQuickItem *systemButtonArea() const;
44 Q_INVOKABLE void setSystemButtonArea(QQuickItem *item);
45
46 Q_INVOKABLE ScreenRectCallback systemButtonAreaCallback() const;
47 Q_INVOKABLE void setSystemButtonAreaCallback(const ScreenRectCallback &callback);
48#endif
49
50 Q_SIGNALS:
51 void titleBarWidgetChanged(QQuickItem *item);
52 void systemButtonChanged(SystemButton button, QQuickItem *item);
53
54 protected:
55 QuickWindowAgent(QuickWindowAgentPrivate &d, QObject *parent = nullptr);
56 };
57
58}
59
60#endif // QUICKWINDOWAGENT_H
QuickWindowAgent is the window agent for QtQuick.
Definition quickwindowagent.h:18
WindowAgentBase is the base class of the specifiy window agent for QtWidgets and QtQuick.
Definition windowagentbase.h:18
QWindowKit namespace.
Definition abstractwindowcontext.cpp:13