From 1174b69ee13d372cb01fc351d5ba158a6909744c Mon Sep 17 00:00:00 2001 From: Jiang Jiang Date: Thu, 7 Jul 2011 08:36:45 +0200 Subject: Fix regressions in previous QFontDatabase patch 1. QtFontStyle::Key comparison should either use styleName or style, etc., but not both. 2. When initializing a QFont from QFontDatabase::font(), style and weight parameters should always be set even when we found a match styleName, in case these parameters will be used for comparison later. 3. Move styleName out of QtFontStyle::Key so that the code can be clearer and more explicit. Change-Id: Icdee8e97568a0f31f57d2cdb8d414f47331fde75 Reviewed-by: Eskil Reviewed-on: http://codereview.qt.nokia.com/1263 Reviewed-by: Qt Sanity Bot Reviewed-by: Jiang Jiang --- src/gui/text/qfontdatabase_qpa.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/text/qfontdatabase_qpa.cpp') diff --git a/src/gui/text/qfontdatabase_qpa.cpp b/src/gui/text/qfontdatabase_qpa.cpp index fd5c6b4510..6b6f4f1a54 100644 --- a/src/gui/text/qfontdatabase_qpa.cpp +++ b/src/gui/text/qfontdatabase_qpa.cpp @@ -73,7 +73,7 @@ Q_GUI_EXPORT void qt_registerFont(const QString &familyName, const QString &fou } QtFontFoundry *foundry = f->foundry(foundryname, true); - QtFontStyle *fontStyle = foundry->style(styleKey, true); + QtFontStyle *fontStyle = foundry->style(styleKey, QString(), true); fontStyle->smoothScalable = scalable; fontStyle->antialiased = antialiased; QtFontSize *size = fontStyle->pixelSize(pixelSize?pixelSize:SMOOTH_SCALABLE, true); -- cgit v1.2.3