Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
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
10#include <QtCore/qshareddata.h>
11
13
14
15class Q_GUI_EXPORT QFontInfo
16{
17public:
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.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
47private:
48 QExplicitlySharedDataPointer<QFontPrivate> d;
49};
50
51Q_DECLARE_SHARED(QFontInfo)
52
54
55#endif // QFONTINFO_H
\reentrant
Definition qfontinfo.h:16
bool bold() const
Returns true if weight() would return a value greater than QFont::Normal; otherwise returns false.
Definition qfontinfo.h:34
void swap(QFontInfo &other) noexcept
Definition qfontinfo.h:24
\reentrant
Definition qfont.h:22
StyleHint
Style hints are used by the \l{QFont}{font matching} algorithm to find an appropriate default family ...
Definition qfont.h:25
@ Normal
Definition qfont.h:67
Style
This enum describes the different styles of glyphs that are used to display text.
Definition qfont.h:76
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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:187
QSharedPointer< T > other(t)
[5]