diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-06-23 14:19:48 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-06-27 09:41:24 +0200 |
commit | a06c8405d053b16327d65415f3335eceb37abd3b (patch) | |
tree | ab18d19622df59d04d0ed408cbd747e487934049 /src/gui/text | |
parent | 3ff0f5f06d42913a749213a6ce1a88832f517273 (diff) |
Add styleName to QFontDef comparison
To make sure we cache different font engines with different style
names.
Task-number: QTBUG-19366
Change-Id: Iefaebd5418f212ff759e03c1745f839a7f23d013
Reviewed-on: http://codereview.qt.nokia.com/738
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfont.cpp | 1 | ||||
-rw-r--r-- | src/gui/text/qfont_p.h | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index d4c81b90db..e771b070ed 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -147,6 +147,7 @@ bool QFontDef::exactMatch(const QFontDef &other) const && weight == other.weight && style == other.style && this_family == other_family + && styleName == other.styleName && (this_foundry.isEmpty() || other_foundry.isEmpty() || this_foundry == other_foundry) diff --git a/src/gui/text/qfont_p.h b/src/gui/text/qfont_p.h index 8eeae6ffc1..4ae31c38d6 100644 --- a/src/gui/text/qfont_p.h +++ b/src/gui/text/qfont_p.h @@ -113,6 +113,7 @@ struct QFontDef && styleStrategy == other.styleStrategy && ignorePitch == other.ignorePitch && fixedPitch == other.fixedPitch && family == other.family + && styleName == other.styleName && hintingPreference == other.hintingPreference #ifdef Q_WS_X11 && addStyle == other.addStyle @@ -128,6 +129,8 @@ struct QFontDef if (styleHint != other.styleHint) return styleHint < other.styleHint; if (styleStrategy != other.styleStrategy) return styleStrategy < other.styleStrategy; if (family != other.family) return family < other.family; + if (!styleName.isEmpty() && !other.styleName.isEmpty() && styleName != other.styleName) + return styleName < other.styleName; if (hintingPreference != other.hintingPreference) return hintingPreference < other.hintingPreference; #ifdef Q_WS_X11 |