Doc: Improve deprecation description for QApplication::fontMetrics()
Add a link to QFontMetrics, which provides more information about the differences between QFontMetrics and QFontMetricsF and why the latter is the preferred choice. Fixes: QTBUG-127528 Pick-to: 6.9 6.8 6.5 6.2 Change-Id: Ib5713a9d39bf312a6eae6b8b1a6d1dc1d47e25be Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io> Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
This commit is contained in:
parent
9b475eadfc
commit
bdf453afd7
@ -1574,14 +1574,18 @@ QWidget *QApplication::activeWindow()
|
|||||||
return QApplicationPrivate::active_window;
|
return QApplicationPrivate::active_window;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6,0)
|
|
||||||
/*!
|
/*!
|
||||||
\deprecated Use the QFontMetricsF constructor instead.
|
\fn QFontMetrics QApplication::fontMetrics()
|
||||||
Returns display (screen) font metrics for the application font.
|
\deprecated [6.0] Use QFontMetricsF(qApp->font()) instead.
|
||||||
|
|
||||||
|
Returns display (screen) font metrics for the application font. For more
|
||||||
|
information about the difference between \l QFontMetrics and \l QFontMetricsF,
|
||||||
|
see the detailed description of \l QFontMetrics.
|
||||||
|
|
||||||
\sa font(), setFont(), QWidget::fontMetrics(), QPainter::fontMetrics()
|
\sa font(), setFont(), QWidget::fontMetrics(), QPainter::fontMetrics()
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if QT_DEPRECATED_SINCE(6,0)
|
||||||
QFontMetrics QApplication::fontMetrics()
|
QFontMetrics QApplication::fontMetrics()
|
||||||
{
|
{
|
||||||
return QApplicationPrivate::desktop()->fontMetrics();
|
return QApplicationPrivate::desktop()->fontMetrics();
|
||||||
|
@ -66,7 +66,7 @@ public:
|
|||||||
static void setFont(const QFont &, const char* className = nullptr);
|
static void setFont(const QFont &, const char* className = nullptr);
|
||||||
|
|
||||||
#if QT_DEPRECATED_SINCE(6,0)
|
#if QT_DEPRECATED_SINCE(6,0)
|
||||||
QT_DEPRECATED_VERSION_X_6_0("Use the QFontMetricsF constructor instead.")
|
QT_DEPRECATED_VERSION_X_6_0("Use QFontMetricsF(qApp->font()) instead.")
|
||||||
static QFontMetrics fontMetrics();
|
static QFontMetrics fontMetrics();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user