QWindowKit  1.5.1.0
Cross-platform window customization framework
Loading...
Searching...
No Matches
windowagentbase.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 WINDOWAGENTBASE_H
6#define WINDOWAGENTBASE_H
7
8#include <memory>
9
10#include <QtCore/QObject>
11
12#include <QWKCore/qwkglobal.h>
13
14namespace QWK {
15
16 class WindowAgentBasePrivate;
17
18 class QWK_CORE_EXPORT WindowAgentBase : public QObject {
19 Q_OBJECT
20 Q_DECLARE_PRIVATE(WindowAgentBase)
21 public:
22 ~WindowAgentBase() override;
23
24 enum SystemButton {
25 Unknown,
26 WindowIcon,
27 Help,
28 Minimize,
29 Maximize,
30 Close,
31 };
32 Q_ENUM(SystemButton)
33
34 QVariant windowAttribute(const QString &key) const;
35 Q_INVOKABLE bool setWindowAttribute(const QString &key, const QVariant &attribute);
36
37 public Q_SLOTS:
38 void showSystemMenu(const QPoint &pos); // Not available on macOS.
39 void centralize();
40 void raise();
41
42 protected:
43 explicit WindowAgentBase(WindowAgentBasePrivate &d, QObject *parent = nullptr);
44
45 const std::unique_ptr<WindowAgentBasePrivate> d_ptr;
46 };
47
48}
49
50#endif // WINDOWAGENTBASE_H
WindowAgentBase is the base class of the specifiy window agent for QtWidgets and QtQuick.
Definition windowagentbase.h:18
~WindowAgentBase() override
QWindowKit namespace.
Definition abstractwindowcontext.cpp:13