Use the cached font fallback families list in QFont::defaultFamily()
Change-Id: Iba1d9db05f7a09aabb81d0429e6081cd7710d381 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
This commit is contained in:
parent
674b0e2382
commit
b8189ddd80
@ -2110,6 +2110,9 @@ QString QFont::lastResortFamily() const
|
||||
return QString::fromLatin1("helvetica");
|
||||
}
|
||||
|
||||
extern QStringList qt_fallbacksForFamily(const QString &family, QFont::Style style,
|
||||
QFont::StyleHint styleHint, QChar::Script script);
|
||||
|
||||
/*!
|
||||
\fn QString QFont::defaultFamily() const
|
||||
|
||||
@ -2120,8 +2123,7 @@ QString QFont::lastResortFamily() const
|
||||
*/
|
||||
QString QFont::defaultFamily() const
|
||||
{
|
||||
QPlatformFontDatabase *fontDB = QGuiApplicationPrivate::platformIntegration()->fontDatabase();
|
||||
const QStringList fallbacks = fontDB->fallbacksForFamily(QString(), QFont::StyleNormal
|
||||
const QStringList fallbacks = qt_fallbacksForFamily(QString(), QFont::StyleNormal
|
||||
, QFont::StyleHint(d->request.styleHint), QChar::Script_Common);
|
||||
if (!fallbacks.isEmpty())
|
||||
return fallbacks.first();
|
||||
|
Loading…
Reference in New Issue
Block a user