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_PRIVATE_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 | |
51 | void setVisible(bool visible); |
52 | void setVisibility(QWindow::Visibility visibility); |
53 | |
54 | QObject *screen() const; |
55 | void setScreen(QObject *screen); |
56 | |
57 | static QQuickWindowAttached *qmlAttachedProperties(QObject *object); |
58 | |
59 | Q_SIGNALS: |
60 | void visibleChanged(bool arg); |
61 | void visibilityChanged(QWindow::Visibility visibility); |
62 | Q_REVISION(2, 3) void screenChanged(); |
63 | |
64 | protected: |
65 | void classBegin() override; |
66 | void componentComplete() override; |
67 | |
68 | QQuickWindowQmlImpl(QQuickWindowQmlImplPrivate &dd, QWindow *parent); |
69 | |
70 | private Q_SLOTS: |
71 | void setWindowVisibility(); |
72 | |
73 | private: |
74 | bool transientParentVisible(); |
75 | |
76 | private: |
77 | Q_DISABLE_COPY(QQuickWindowQmlImpl) |
78 | Q_DECLARE_PRIVATE(QQuickWindowQmlImpl) |
79 | }; |
80 | |
81 | QT_END_NAMESPACE |
82 | |
83 | QML_DECLARE_TYPE(QQuickWindowQmlImpl) |
84 | |
85 | #endif |
86 |