diff --git a/src/gui/text/coretext/qcoretextfontdatabase.mm b/src/gui/text/coretext/qcoretextfontdatabase.mm index 8665faca83..fe7500b7f8 100644 --- a/src/gui/text/coretext/qcoretextfontdatabase.mm +++ b/src/gui/text/coretext/qcoretextfontdatabase.mm @@ -863,12 +863,7 @@ QFont *QCoreTextFontDatabase::themeFont(QPlatformTheme::Font f) const QFont QCoreTextFontDatabase::defaultFont() const { - if (defaultFontName.isEmpty()) { - QCFType systemFont = descriptorForFontType(kCTFontUIFontSystem); - defaultFontName = QCFString(CTFontDescriptorCopyAttribute(systemFont, kCTFontFamilyNameAttribute)); - } - - return QFont(defaultFontName); + return QFont(*themeFont(QPlatformTheme::SystemFont)); } bool QCoreTextFontDatabase::fontsAlwaysScalable() const diff --git a/src/gui/text/coretext/qcoretextfontdatabase_p.h b/src/gui/text/coretext/qcoretextfontdatabase_p.h index 12f55bd8ad..4e847dc32f 100644 --- a/src/gui/text/coretext/qcoretextfontdatabase_p.h +++ b/src/gui/text/coretext/qcoretextfontdatabase_p.h @@ -91,8 +91,6 @@ private: void populateFromDescriptor(CTFontDescriptorRef font, const QString &familyName = QString(), QFontDatabasePrivate::ApplicationFont *applicationFont = nullptr); static CFArrayRef fallbacksForFamily(const QString &family); - mutable QString defaultFontName; - QHash m_themeFonts; QHash>> m_systemFontDescriptors;