From 4f2e0117f9b842d9aa2a9bb04aabd9fb09774f1d Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 28 Sep 2018 09:31:12 +0200 Subject: Deprecate QFont::lastResortFamily() and QFont::lastResortFont() These functions have not been used by the font selection algorithm in Qt 5. Calling lastResortFamily() always gave you "helvetica" and lastResortFont() would actually crash. Since we cannot remove them before Qt 6, we deprecate them for now and update the documentation to give a more accurate description of how the font matching works in Qt 5. Note that in the non-native QFontDialog, it tries to implement its own font matching algorithm and therefore was calling lastResortFamily(). Since fixing QFontDialog is not within the scope of this patch, I have just replaced the call by "helvetica" directly, so that it will continue to behave the same. [ChangeLog][QtGui][Text] Deprecated QFont::lastResortFamily() and QFont::lastResortFont() which are not in use in Qt 5 and did not provide any useful information. Task-number: QTBUG-60813 Change-Id: Id8fe7bfdd427292ef86bc8405de03cb466b9b62a Reviewed-by: Lars Knoll --- src/gui/text/qfont.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gui/text/qfont.h') diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index 9c250c82c3..a94586166e 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -282,8 +282,10 @@ public: static void cacheStatistics(); QString defaultFamily() const; - QString lastResortFamily() const; - QString lastResortFont() const; +#if QT_DEPRECATED_SINCE(5, 13) + QT_DEPRECATED QString lastResortFamily() const; + QT_DEPRECATED QString lastResortFont() const; +#endif QFont resolve(const QFont &) const; inline uint resolve() const { return resolve_mask; } -- cgit v1.2.3