diff options
author | Nico Vertriest <nico.vertriest@qt.io> | 2021-06-01 11:38:06 +0200 |
---|---|---|
committer | Nico Vertriest <nico.vertriest@qt.io> | 2021-07-26 12:37:12 +0200 |
commit | 111115bf8862b7cd1197c2ef8a4b475c882776d4 (patch) | |
tree | 72e585f01df3a93a1e480709db030fd7d47a99ea /src/gui/text | |
parent | bd0d8a3adb98ff6f659e44e9a46decee32e9d94c (diff) |
Doc: Ensure deprecated APIs in Gui are documented as such
Added missing #if-ery and deprecation macros to a QFont constructor
that was only documented as deprecated.
Fixes: QTBUG-94521
Fixes: QTBUG-95310
Pick-to: 6.2 6.1
Change-Id: I3d0418a3f7dca191a9068cc22627fe4deb7c53c5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfont.cpp | 11 | ||||
-rw-r--r-- | src/gui/text/qfont.h | 4 | ||||
-rw-r--r-- | src/gui/text/qfontdatabase.cpp | 2 | ||||
-rw-r--r-- | src/gui/text/qtextformat.cpp | 6 |
4 files changed, 15 insertions, 8 deletions
diff --git a/src/gui/text/qfont.cpp b/src/gui/text/qfont.cpp index b6d7160cd4..eb682388ff 100644 --- a/src/gui/text/qfont.cpp +++ b/src/gui/text/qfont.cpp @@ -691,8 +691,10 @@ QFont::QFont() { } +#if QT_DEPRECATED_SINCE(6, 2) /*! - \deprecated + \deprecated [6.2] Use the overload taking a QStringList instead. + Constructs a font object with the specified \a family, \a pointSize, \a weight and \a italic settings. @@ -738,6 +740,7 @@ QFont::QFont(const QString &family, int pointSize, int weight, bool italic) d->request.weight = weight; d->request.style = italic ? QFont::StyleItalic : QFont::StyleNormal; } +#endif /*! Constructs a font object with the specified \a families, \a @@ -1183,7 +1186,7 @@ QFont::Weight QFont::weight() const #if QT_DEPRECATED_SINCE(6, 0) /*! - \deprecated Use setWeight() instead. + \deprecated [6.0] Use setWeight() instead. Sets the weight of the font to \a legacyWeight using the legacy font weight scale of Qt 5 and previous versions. @@ -1195,7 +1198,7 @@ QFont::Weight QFont::weight() const \note If styleName() is set, this value may be ignored for font selection. - \sa setWeight(), weight(), legacyWeight(), QFontInfo + \sa setWeight(), weight(), QFontInfo */ void QFont::setLegacyWeight(int legacyWeight) { @@ -1203,7 +1206,7 @@ void QFont::setLegacyWeight(int legacyWeight) } /*! - \deprecated Use weight() instead. + \deprecated [6.0] Use weight() instead. Returns the weight of the font converted to the non-standard font weight scale used in Qt 5 and earlier versions. diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h index 87fc08dda9..72c65f6274 100644 --- a/src/gui/text/qfont.h +++ b/src/gui/text/qfont.h @@ -167,7 +167,11 @@ public: Q_ENUM(ResolveProperties) QFont(); + +#if QT_DEPRECATED_SINCE(6, 2) + QT_DEPRECATED_VERSION_X_6_2("Pass QStringList{family} or family.split(QLatin1Char(',')) instead of family") QFont(const QString &family, int pointSize = -1, int weight = -1, bool italic = false); +#endif explicit QFont(const QStringList &families, int pointSize = -1, int weight = -1, bool italic = false); QFont(const QFont &font, const QPaintDevice *pd); QFont(const QFont &font); diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index 3eb59e0f04..02ac67ce9e 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -1239,7 +1239,7 @@ QString QFontDatabase::styleString(const QFontInfo &fontInfo) /*! \fn QFontDatabase::QFontDatabase() - \deprecated Call the class methods as static functions instead. + \deprecated [6.0] Call the class methods as static functions instead. Creates a font database object. */ diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 0166cd7ad2..caa2eb0f3f 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -1373,7 +1373,7 @@ bool QTextFormat::operator==(const QTextFormat &rhs) const The font used can be set by supplying a font to the setFont() function, and each aspect of its appearance can be adjusted to give the desired effect. - setFontFamily() and setFontPointSize() define the font's family (e.g. Times) + setFontFamilies() and setFontPointSize() define the font's family (e.g. Times) and printed size; setFontWeight() and setFontItalic() provide control over the style of the font. setFontUnderline(), setFontOverline(), setFontStrikeOut(), and setFontFixedPitch() provide additional effects for @@ -1457,7 +1457,7 @@ QTextCharFormat::QTextCharFormat(const QTextFormat &fmt) /*! \fn void QTextCharFormat::setFontFamily(const QString &family) - \deprecated Use setFontFamilies() instead. + \deprecated [6.1] Use setFontFamilies() instead. Sets the text format's font \a family. @@ -1467,7 +1467,7 @@ QTextCharFormat::QTextCharFormat(const QTextFormat &fmt) /*! \fn QString QTextCharFormat::fontFamily() const - \deprecated Use fontFamilies() instead. + \deprecated [6.1] Use fontFamilies() instead. Returns the text format's font family. |