summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont.cpp
diff options
context:
space:
mode:
authorDavid Faure <david.faure@kdab.com>2017-01-09 00:10:42 +0100
committerDavid Faure <david.faure@kdab.com>2017-01-11 15:15:39 +0000
commit2bb01172a76f14b1f57010b79207f6b9a9bf3f53 (patch)
treeff6e64b06e334f77951be90caf93c2ee94b26a90 /src/gui/text/qfont.cpp
parent62882ad2fe3d9f70c876d7a51a5aab4118ce1ba3 (diff)
QFont: fix fromString(toString()) when application font has styleName
The style name needs to be cleared if not present in the string, otherwise the style name from qApp->font() (which propagates to any default-constructed QFont) remains. Change-Id: I9b6522a39a38526cced8a11ed02ae32582026480 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com>
Diffstat (limited to 'src/gui/text/qfont.cpp')
-rw-r--r--src/gui/text/qfont.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp
index 3b24039ea6..7f3ed3adaa 100644
--- a/src/gui/text/qfont.cpp
+++ b/src/gui/text/qfont.cpp
@@ -2077,6 +2077,8 @@ bool QFont::fromString(const QString &descrip)
setFixedPitch(l[8].toInt());
if (count == 11)
d->request.styleName = l[10].toString();
+ else
+ d->request.styleName.clear();
}
if (count >= 9 && !d->request.fixedPitch) // assume 'false' fixedPitch equals default