diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-06-23 12:19:48 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-06-25 12:21:22 (GMT) |
commit | 1481955dd93acea1c5cf684e3f753d80f614e9bf (patch) | |
tree | 9a0835d54343b7d86d0d7e6eb6cfc403017ddf25 /src/gui | |
parent | bc730b8a703856559980adadddda745405e9b806 (diff) | |
download | Qt-1481955dd93acea1c5cf684e3f753d80f614e9bf.zip Qt-1481955dd93acea1c5cf684e3f753d80f614e9bf.tar.gz Qt-1481955dd93acea1c5cf684e3f753d80f614e9bf.tar.bz2 |
Add styleName to QFontDef comparison
To make sure we cache different font engines with different style
names.
Task-number: QTBUG-19366
Diffstat (limited to 'src/gui')
-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 d4c81b9..e771b07 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 8eeae6f..4ae31c3 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 |