path: root/src/gui/text/qfont.h
diff options
authorTor Arne Vestbø <>2018-12-19 18:14:59 +0100
committerKonstantin Ritt <>2019-02-11 13:14:07 +0000
commitece341e2f3ef90204b209012b2099b8e599eee08 (patch)
tree9a613a25bbb444ff82fd3043fafad9574d712c82 /src/gui/text/qfont.h
parente3f16e7a42893447631321b02a2468c3b1fa35fb (diff)
Allow more fine grained control over QFont debug output
With verbosity level 0, only the resolved properties are included in the debug output, which is useful when debugging font resolving. With verbosity level 1, the family, size, and weights are included, plus any resolved property that is different from the default value. Verbosity level 2, the QDebug default, has been kept unchanged, except removing quotes and spaces by adding nospace() and qPrintable. Verbosity level 3 includes all properties, regardless of whether or not they have been resolved. Levels 1 and 3 also include the resolve mask, to aid debugging. This gives the following results for a QFont set to 100pt: QFont(100pt) QFont(".SF NS Text", 100pt, Weight::Normal, resolveMask=SizeResolved) QFont(.SF NS Text,100,-1,5,50,0,0,0,0,0) QFont(".SF NS Text", 100pt, StyleHint::AnyStyle, StyleStrategy::PreferDefault, Weight::Normal, StyleNormal, underline=false, overline=false, strikeOut=false, fixedPitch=false, AnyStretch, kerning=true, MixedCase, letterSpacing=0 (PercentageSpacing), PreferDefaultHinting, styleName="", resolveMask=SizeResolved) Change-Id: Ib4aebd7346ef4a2946cc4450c12730cf7844c3bc Reviewed-by: Konstantin Ritt <> Reviewed-by: Lars Knoll <>
Diffstat (limited to 'src/gui/text/qfont.h')
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index e86f06353a..35ef798275 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -147,6 +147,7 @@ public:
enum ResolveProperties {
+ NoPropertiesResolved = 0x0000,
FamilyResolved = 0x0001,
SizeResolved = 0x0002,
StyleHintResolved = 0x0004,
@@ -167,6 +168,7 @@ public:
FamiliesResolved = 0x20000,
AllPropertiesResolved = 0x3ffff
+ Q_ENUM(ResolveProperties)
QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false);
@@ -335,6 +337,10 @@ private:
friend Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QFont &);
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QFont &);
QExplicitlySharedDataPointer<QFontPrivate> d;
uint resolve_mask;