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
qquickfontinfo_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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 QQUICKFONTINFO_P_H
6#define QQUICKFONTINFO_P_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#include <QtGui/qfontinfo.h>
23#include <QtCore/qobject.h>
24
25#include <QtQuick/private/qquickvaluetypes_p.h>
26
28
29class Q_QUICK_EXPORT QQuickFontInfo : public QObject
30{
31 Q_OBJECT
32
33 Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL)
34 Q_PROPERTY(QString family READ family NOTIFY fontChanged FINAL)
35 Q_PROPERTY(QString styleName READ styleName NOTIFY fontChanged FINAL)
36 Q_PROPERTY(int pixelSize READ pixelSize NOTIFY fontChanged FINAL)
37 Q_PROPERTY(qreal pointSize READ pointSize NOTIFY fontChanged FINAL)
38 Q_PROPERTY(bool italic READ italic NOTIFY fontChanged FINAL)
39 Q_PROPERTY(int weight READ weight NOTIFY fontChanged FINAL)
40 Q_PROPERTY(bool bold READ bold NOTIFY fontChanged FINAL)
41 Q_PROPERTY(bool fixedPitch READ fixedPitch NOTIFY fontChanged FINAL)
42 Q_PROPERTY(QQuickFontEnums::Style style READ style NOTIFY fontChanged FINAL)
43 Q_PROPERTY(QList<QFontVariableAxis> variableAxes READ variableAxes NOTIFY fontChanged FINAL)
44 QML_NAMED_ELEMENT(FontInfo)
45 QML_ADDED_IN_VERSION(6, 9)
46public:
47 explicit QQuickFontInfo(QObject *parent = nullptr);
48 ~QQuickFontInfo() override;
49
50 QFont font() const;
51 void setFont(QFont font);
52
53 QString family() const;
54 QString styleName() const;
55 int pixelSize() const;
56 qreal pointSize() const;
57 bool italic() const;
58 int weight() const;
59 bool bold() const;
60 bool underline() const;
61 bool overline() const;
62 bool strikeOut() const;
63 bool fixedPitch() const;
64 QQuickFontEnums::Style style() const;
65 QList<QFontVariableAxis> variableAxes() const;
66
67Q_SIGNALS:
68 void fontChanged();
69
70private:
71 QFont m_font;
72 QFontInfo m_info;
73};
74
75QT_END_NAMESPACE
76
77#endif // QQUICKFONTINFO_P_H