summaryrefslogtreecommitdiff
path: root/src/gui/text/qtextformat.cpp
diff options
context:
space:
mode:
authorIvan Solovev <ivan.solovev@qt.io>2022-07-11 17:37:31 +0200
committerIvan Solovev <ivan.solovev@qt.io>2022-07-21 19:59:08 +0200
commit8b029ef142526722a0931ae02b681ad57d7fd99a (patch)
treecacd4bbec29602beb0f2254bbb7a2598e0b7180e /src/gui/text/qtextformat.cpp
parentfc172e3093397990da73e80b737c17ba63375f2c (diff)
downloadqtbase-8b029ef142526722a0931ae02b681ad57d7fd99a.tar.gz
Do not use QTextFormat::FontFamily when building with QT_DISABLE_DEPRECATED_BEFORE >= 0x060000
The QTextFormat::FontFamily enum is deprecated since Qt 6.0, however it is still used in the code. To retain backward compatibility with the old data stream formats, we introduce a new internal QTextFormat::OldFontFamily enum value, which has exactly the same value as QTextFormat::FontFamily, and use it instead. Task-number: QTBUG-104857 Pick-to: 6.4 6.3 6.2 Change-Id: Ibf5258b621c2b0aa507005dfe2c1e80c26ddb0d4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/gui/text/qtextformat.cpp')
-rw-r--r--src/gui/text/qtextformat.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index fa83212033..be38aba368 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -425,7 +425,7 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &stream, const QTextFormat &fmt
it = properties.find(QTextFormat::FontFamilies);
if (it != properties.end()) {
- properties[QTextFormat::FontFamily] = QVariant(it.value().toStringList().first());
+ properties[QTextFormat::OldFontFamily] = QVariant(it.value().toStringList().first());
properties.erase(it);
}
}
@@ -453,7 +453,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
key = QTextFormat::FontStretch;
else if (key == QTextFormat::OldTextUnderlineColor)
key = QTextFormat::TextUnderlineColor;
- else if (key == QTextFormat::FontFamily)
+ else if (key == QTextFormat::OldFontFamily)
key = QTextFormat::FontFamilies;
fmt.d->insertProperty(key, it.value());
}
@@ -625,6 +625,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextTableCellFormat &
Character properties
\value FontFamily e{This property has been deprecated.} Use QTextFormat::FontFamilies instead.
+ \omitvalue OldFontFamily
\value FontFamilies
\value FontStyleName
\value FontPointSize