summaryrefslogtreecommitdiffstats
path: root/src/corelib/serialization/qdatastream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/serialization/qdatastream.cpp')
-rw-r--r--src/corelib/serialization/qdatastream.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/corelib/serialization/qdatastream.cpp b/src/corelib/serialization/qdatastream.cpp
index f9c08cd78e4..4a18c6b781e 100644
--- a/src/corelib/serialization/qdatastream.cpp
+++ b/src/corelib/serialization/qdatastream.cpp
@@ -1031,6 +1031,21 @@ QDataStream &QDataStream::operator>>(char32_t &c)
return *this;
}
+/*!
+ \relates QChar
+
+ Reads a char from the stream \a in into char \a chr.
+
+ \sa {Serializing Qt Data Types}
+*/
+QDataStream &operator>>(QDataStream &in, QChar &chr)
+{
+ quint16 u;
+ in >> u;
+ chr.unicode() = char16_t(u);
+ return in;
+}
+
#if QT_DEPRECATED_SINCE(6, 11)
/*!
@@ -1384,6 +1399,19 @@ QDataStream &QDataStream::operator<<(char32_t c)
}
/*!
+ \relates QChar
+
+ Writes the char \a chr to the stream \a out.
+
+ \sa {Serializing Qt Data Types}
+*/
+QDataStream &operator<<(QDataStream &out, QChar chr)
+{
+ out << quint16(chr.unicode());
+ return out;
+}
+
+/*!
Writes the length specifier \a len and the buffer \a s to the
stream and returns a reference to the stream.