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