From a06c8405d053b16327d65415f3335eceb37abd3b Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Thu, 23 Jun 2011 14:19:48 +0200 Subject: 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 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qfont_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui/text/qfont_p.h') 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 -- cgit v1.2.3