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
23QT_BEGIN_NAMESPACE
24
25class QQuickWindowQmlImplPrivate;
26
27struct QWindowForeign
28{
29 Q_GADGET
30 QML_FOREIGN(QWindow)
31 QML_ANONYMOUS
32 QML_ADDED_IN_VERSION(2, 1)
33};
34
35class 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
48public:
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
59Q_SIGNALS:
60 void visibleChanged(bool arg);
61 void visibilityChanged(QWindow::Visibility visibility);
62 Q_REVISION(2, 3) void screenChanged();
63
64protected:
65 void classBegin() override;
66 void componentComplete() override;
67
68 QQuickWindowQmlImpl(QQuickWindowQmlImplPrivate &dd, QWindow *parent);
69
70private Q_SLOTS:
71 void setWindowVisibility();
72
73private:
74 bool transientParentVisible();
75
76private:
77 Q_DISABLE_COPY(QQuickWindowQmlImpl)
78 Q_DECLARE_PRIVATE(QQuickWindowQmlImpl)
79};
80
81QT_END_NAMESPACE
82
83QML_DECLARE_TYPE(QQuickWindowQmlImpl)
84
85#endif
86

source code of qtdeclarative/src/quick/items/qquickwindowmodule_p.h