Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickfontloader_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKFONTLOADER_H
6#define QQUICKFONTLOADER_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qtquickglobal_p.h>
20
21#include <QtQml/qqml.h>
22
23#include <QtCore/qobject.h>
24#include <QtCore/qurl.h>
25
26QT_BEGIN_NAMESPACE
27
28class QQuickFontLoaderPrivate;
29class Q_QUICK_EXPORT QQuickFontLoader : public QObject
30{
31 Q_OBJECT
32 Q_DECLARE_PRIVATE(QQuickFontLoader)
33
34 Q_PROPERTY(QUrl source READ source WRITE setSource NOTIFY sourceChanged)
35 Q_PROPERTY(QString name READ name NOTIFY nameChanged)
36 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
37 Q_PROPERTY(QFont font READ font NOTIFY fontChanged)
38 QML_NAMED_ELEMENT(FontLoader)
39 QML_ADDED_IN_VERSION(2, 0)
40
41public:
42 enum Status { Null = 0, Ready, Loading, Error };
43 Q_ENUM(Status)
44
45 QQuickFontLoader(QObject *parent = nullptr);
46
47 QUrl source() const;
48 void setSource(const QUrl &url);
49
50 QString name() const;
51
52 QFont font() const;
53
54 Status status() const;
55
56private Q_SLOTS:
57 void updateFontInfo(int);
58
59Q_SIGNALS:
60 void sourceChanged();
61 void nameChanged();
62 void fontChanged();
63 void statusChanged();
64};
65
66QT_END_NAMESPACE
67
68#endif // QQUICKFONTLOADER_H
QHash< QUrl, QQuickFontObject * > map
static void q_QFontLoaderFontsAddReset()
static void q_QFontLoaderFontsStaticReset()
Q_GLOBAL_STATIC(QFontLoaderFonts, fontLoaderFonts)