summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfontdatabase.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-04 15:51:50 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-04-23 16:00:13 +0200
commitd42ad7b01e4d9b9fd097db5c438e7f646ef49b1b (patch)
treea633d6f6821825926a1de928a155bb7a6905ef1a /src/gui/text/qfontdatabase.cpp
parent4ec9b0cd19267d8df6cc6a0926de7a35d01a77ba (diff)
QFontDatabase: Clear font cache before emitting fontDatabaseChanged
Matches the ordering in QFontDatabasePrivate::invalidate() and ensures that when the fontDatabaseChanged signal is processed by clients the cache is ready to be filled again. Change-Id: I9d09060284c6090ae2748147f6ee75b9f9b173c5 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/gui/text/qfontdatabase.cpp')
-rw-r--r--src/gui/text/qfontdatabase.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp
index 5d72a7b909..00e4567472 100644
--- a/src/gui/text/qfontdatabase.cpp
+++ b/src/gui/text/qfontdatabase.cpp
@@ -2188,12 +2188,12 @@ int QFontDatabasePrivate::addAppFont(const QByteArray &fontData, const QString &
applicationFonts[i] = font;
- emit qApp->fontDatabaseChanged();
-
// The font cache may have cached lookups for the font that was now
// loaded, so it has to be flushed.
QFontCache::instance()->clear();
+ emit qApp->fontDatabaseChanged();
+
return i;
}