diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2018-09-28 09:31:12 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2018-10-09 06:55:42 +0000 |
commit | 4f2e0117f9b842d9aa2a9bb04aabd9fb09774f1d (patch) | |
tree | 13fd7ac988e6f069dd6736e77c92d7d233cde77a /src/gui/text/qfont.h | |
parent | 69b6845edbb43cf7000942d07f3a326383bdf6d2 (diff) |
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 <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text/qfont.h')
-rw-r--r-- | src/gui/text/qfont.h | 6 |
1 files changed, 4 insertions, 2 deletions
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; } |