Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qfontinfo.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
4#ifndef QFONTINFO_H
5#define QFONTINFO_H
6
7#include <QtGui/qtguiglobal.h>
8#include <QtGui/qfont.h>
9
11
12
13class Q_GUI_EXPORT QFontInfo
14{
15public:
16 QFontInfo(const QFont &);
17 QFontInfo(const QFontInfo &);
18 ~QFontInfo();
19
20 QFontInfo &operator=(const QFontInfo &);
21
22 void swap(QFontInfo &other) noexcept { d.swap(other.d); }
23
24 QString family() const;
25 QString styleName() const;
26 int pixelSize() const;
27 int pointSize() const;
28 qreal pointSizeF() const;
29 bool italic() const;
30 QFont::Style style() const;
31 int weight() const;
32 inline bool bold() const { return weight() > QFont::Normal; }
33 bool underline() const;
34 bool overline() const;
35 bool strikeOut() const;
36 bool fixedPitch() const;
37 QFont::StyleHint styleHint() const;
38
39#if QT_DEPRECATED_SINCE(6, 0)
40 QT_DEPRECATED_VERSION_X_6_0("Use weight() instead") int legacyWeight() const;
41#endif
42
43 bool exactMatch() const;
44
45private:
47};
48
49Q_DECLARE_SHARED(QFontInfo)
50
52
53#endif // QFONTINFO_H
\reentrant
Definition qfontinfo.h:14
bool bold() const
Returns true if weight() would return a value greater than QFont::Normal; otherwise returns false.
Definition qfontinfo.h:32
void swap(QFontInfo &other) noexcept
Definition qfontinfo.h:22
\reentrant
Definition qfont.h:20
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
Definition qfont.h:23
@ Normal
Definition qfont.h:64
Style
This enum describes the different styles of glyphs that are used to display text.
Definition qfont.h:73
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
Combined button and popup list for selecting options.
GLuint GLuint GLfloat weight
#define QT_DEPRECATED_VERSION_X_6_0(text)
double qreal
Definition qtypes.h:92
QSharedPointer< T > other(t)
[5]