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 QQUICKAPPLICATION_P_H
5#define QQUICKAPPLICATION_P_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 <QtQuick/private/qtquickglobal_p.h>
19#include <QtQuick/private/qquickscreen_p.h>
20
21#include <QtQml/qqml.h>
22#include <QtQml/private/qqmlglobal_p.h>
23
24#include <QtGui/qfont.h>
25#include <QtGui/qstylehints.h>
26
27#include <QtCore/qobject.h>
28
29QT_BEGIN_NAMESPACE
30
31class Q_QUICK_PRIVATE_EXPORT QQuickApplication : public QQmlApplication
32{
33 Q_OBJECT
34 Q_PROPERTY(bool active READ active NOTIFY activeChanged FINAL) // deprecated, use 'state' instead
35 Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection NOTIFY layoutDirectionChanged FINAL)
36 Q_PROPERTY(bool supportsMultipleWindows READ supportsMultipleWindows CONSTANT FINAL)
37 Q_PROPERTY(Qt::ApplicationState state READ state NOTIFY stateChanged FINAL)
38 Q_PROPERTY(QFont font READ font CONSTANT FINAL)
39 Q_PROPERTY(QString displayName READ displayName WRITE setDisplayName NOTIFY displayNameChanged FINAL)
40 Q_PROPERTY(QQmlListProperty<QQuickScreenInfo> screens READ screens NOTIFY screensChanged FINAL)
41 Q_PROPERTY(QStyleHints *styleHints READ styleHints CONSTANT FINAL)
42
43 QML_NAMED_ELEMENT(Application)
44 QML_SINGLETON
45 QML_ADDED_IN_VERSION(2, 0)
46
47public:
48 explicit QQuickApplication(QObject *parent = nullptr);
49 virtual ~QQuickApplication();
50 bool active() const;
51 Qt::LayoutDirection layoutDirection() const;
52 bool supportsMultipleWindows() const;
53 Qt::ApplicationState state() const;
54 QFont font() const;
55 QQmlListProperty<QQuickScreenInfo> screens();
56 QString displayName() const;
57 void setDisplayName(const QString &displayName);
58 QStyleHints *styleHints();
59
60Q_SIGNALS:
61 void activeChanged();
62 void displayNameChanged();
63 void layoutDirectionChanged();
64 void stateChanged(Qt::ApplicationState state);
65 void screensChanged();
66
67private Q_SLOTS:
68 void updateScreens();
69
70private:
71 Q_DISABLE_COPY(QQuickApplication)
72 QVector<QQuickScreenInfo *> m_screens;
73};
74
75QT_END_NAMESPACE
76
77QML_DECLARE_TYPE(QQuickApplication)
78
79#endif // QQUICKAPPLICATION_P_H
80

source code of qtdeclarative/src/quick/util/qquickapplication_p.h