diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index ab9d7fd98a3..40894c28702 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1574,14 +1574,18 @@ QWidget *QApplication::activeWindow() return QApplicationPrivate::active_window; } -#if QT_DEPRECATED_SINCE(6,0) /*! - \deprecated Use the QFontMetricsF constructor instead. - Returns display (screen) font metrics for the application font. + \fn QFontMetrics QApplication::fontMetrics() + \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() */ +#if QT_DEPRECATED_SINCE(6,0) QFontMetrics QApplication::fontMetrics() { return QApplicationPrivate::desktop()->fontMetrics(); diff --git a/src/widgets/kernel/qapplication.h b/src/widgets/kernel/qapplication.h index c54aff4a233..83dfdc50bcd 100644 --- a/src/widgets/kernel/qapplication.h +++ b/src/widgets/kernel/qapplication.h @@ -66,7 +66,7 @@ public: static void setFont(const QFont &, const char* className = nullptr); #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(); #endif