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 QFONTINFO_H |
5 | #define QFONTINFO_H |
6 | |
7 | #include <QtGui/qtguiglobal.h> |
8 | #include <QtGui/qfont.h> |
9 | |
10 | #include <QtCore/qshareddata.h> |
11 | |
12 | QT_BEGIN_NAMESPACE |
13 | |
14 | |
15 | class Q_GUI_EXPORT QFontInfo |
16 | { |
17 | public: |
18 | QFontInfo(const QFont &); |
19 | QFontInfo(const QFontInfo &); |
20 | ~QFontInfo(); |
21 | |
22 | QFontInfo &operator=(const QFontInfo &); |
23 | |
24 | void swap(QFontInfo &other) noexcept { d.swap(other&: other.d); } |
25 | |
26 | QString family() const; |
27 | QString styleName() const; |
28 | int pixelSize() const; |
29 | int pointSize() const; |
30 | qreal pointSizeF() const; |
31 | bool italic() const; |
32 | QFont::Style style() const; |
33 | int weight() const; |
34 | inline bool bold() const { return weight() > QFont::Normal; } |
35 | bool underline() const; |
36 | bool overline() const; |
37 | bool strikeOut() const; |
38 | bool fixedPitch() const; |
39 | QFont::StyleHint styleHint() const; |
40 | |
41 | #if QT_DEPRECATED_SINCE(6, 0) |
42 | QT_DEPRECATED_VERSION_X_6_0("Use weight() instead" ) int legacyWeight() const; |
43 | #endif |
44 | |
45 | bool exactMatch() const; |
46 | |
47 | private: |
48 | QExplicitlySharedDataPointer<QFontPrivate> d; |
49 | }; |
50 | |
51 | Q_DECLARE_SHARED(QFontInfo) |
52 | |
53 | QT_END_NAMESPACE |
54 | |
55 | #endif // QFONTINFO_H |
56 | |