1 | // Copyright (C) 2016 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICKWINDOWMODULE_H |
5 | #define QQUICKWINDOWMODULE_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <private/qtquickglobal_p.h> |
19 | #include <qquickwindow.h> |
20 | #include <qqmlparserstatus.h> |
21 | #include <private/qquickwindowattached_p.h> |
22 | |
23 | QT_BEGIN_NAMESPACE |
24 | |
25 | class QQuickWindowQmlImplPrivate; |
26 | |
27 | struct QWindowForeign |
28 | { |
29 | Q_GADGET |
30 | QML_FOREIGN(QWindow) |
31 | QML_ANONYMOUS |
32 | QML_ADDED_IN_VERSION(2, 1) |
33 | }; |
34 | |
35 | class Q_QUICK_EXPORT QQuickWindowQmlImpl : public QQuickWindow, public QQmlParserStatus |
36 | { |
37 | Q_OBJECT |
38 | Q_INTERFACES(QQmlParserStatus) |
39 | |
40 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged) |
41 | Q_PROPERTY(QWindow::Visibility visibility READ visibility WRITE setVisibility NOTIFY |
42 | visibilityChanged) |
43 | Q_PROPERTY(QObject *screen READ screen WRITE setScreen NOTIFY screenChanged REVISION(2, 3)) |
44 | QML_ATTACHED(QQuickWindowAttached) |
45 | QML_NAMED_ELEMENT(Window) |
46 | QML_ADDED_IN_VERSION(2, 1) |
47 | |
48 | public: |
49 | QQuickWindowQmlImpl(QWindow *parent = nullptr); |
50 | ~QQuickWindowQmlImpl(); |
51 | |
52 | void setVisible(bool visible); |
53 | void setVisibility(QWindow::Visibility visibility); |
54 | |
55 | QObject *screen() const; |
56 | void setScreen(QObject *screen); |
57 | |
58 | QObject *visualParent() const; |
59 | void setVisualParent(QObject *parent); |
60 | void visualParentChanged(QObject *) {}; |
61 | |
62 | void setX(int arg); |
63 | int x() const; |
64 | void setY(int arg); |
65 | int y() const; |
66 | void setZ(qreal arg); |
67 | qreal z() const; |
68 | void zChanged() {}; |
69 | |
70 | static QQuickWindowAttached *qmlAttachedProperties(QObject *object); |
71 | |
72 | Q_SIGNALS: |
73 | void visibleChanged(bool arg); |
74 | void visibilityChanged(QWindow::Visibility visibility); |
75 | Q_REVISION(2, 3) void screenChanged(); |
76 | |
77 | void xChanged(int arg); |
78 | void yChanged(int arg); |
79 | |
80 | protected: |
81 | void classBegin() override; |
82 | void componentComplete() override; |
83 | |
84 | bool event(QEvent *) override; |
85 | |
86 | QQuickWindowQmlImpl(QQuickWindowQmlImplPrivate &dd, QWindow *parent); |
87 | |
88 | private Q_SLOTS: |
89 | Q_REVISION(6, 7) void applyWindowVisibility(); |
90 | Q_REVISION(6, 7) void updateTransientParent(); |
91 | |
92 | private: |
93 | bool transientParentVisible(); |
94 | void applyVisualParent(); |
95 | |
96 | private: |
97 | Q_DISABLE_COPY(QQuickWindowQmlImpl) |
98 | Q_DECLARE_PRIVATE(QQuickWindowQmlImpl) |
99 | }; |
100 | |
101 | QT_END_NAMESPACE |
102 | |
103 | #endif |
104 | |