Add some more logging to QFontDatabase

Change-Id: I5ac289cb7cb0beb842c403683681a739c44b26a1
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
This commit is contained in:
Tor Arne Vestbø 2022-08-19 13:47:41 +02:00
parent c519372dbf
commit 3053df3366

View File

@ -280,6 +280,8 @@ void QFontDatabasePrivate::clearFamilies()
void QFontDatabasePrivate::invalidate()
{
qCDebug(lcFontDb) << "Invalidating font database";
QFontCache::instance()->clear();
fallbacksCache.clear();
@ -564,6 +566,8 @@ void qt_registerFont(const QString &familyName, const QString &stylename,
void qt_registerFontFamily(const QString &familyName)
{
qCDebug(lcFontDb) << "Registering family" << familyName;
// Create uninitialized/unpopulated family
QFontDatabasePrivate::instance()->family(familyName, QFontDatabasePrivate::EnsureCreated);
}
@ -573,6 +577,8 @@ void qt_registerAliasToFontFamily(const QString &familyName, const QString &alia
if (alias.isEmpty())
return;
qCDebug(lcFontDb) << "Registering alias" << alias << "to family" << familyName;
auto *d = QFontDatabasePrivate::instance();
QtFontFamily *f = d->family(familyName, QFontDatabasePrivate::RequestFamily);
if (!f)
@ -1316,6 +1322,7 @@ QFontDatabasePrivate *QFontDatabasePrivate::ensureFontDatabase()
// The font database may have been partially populated, but to ensure
// we can answer queries for any platform- or user-provided family we
// need to fully populate it now.
qCDebug(lcFontDb) << "Populating font database";
if (Q_UNLIKELY(qGuiApp == nullptr || QGuiApplicationPrivate::platformIntegration() == nullptr))
qFatal("QFontDatabase: Must construct a QGuiApplication before accessing QFontDatabase");