QJsonArray: symmetrize QDataStream op>>/<<
In operator<<(), stream the QJsonDocument directly, instead of toJson(Compact). This is how QJsonDocument operator<<() also does things, but that knowledge should be need-to-know, and QJsonArray doesn't, seeing as operator>>() just streams a QJsonDocument, and then calls toArray(). Pick-to: 6.7 6.6 6.5 Change-Id: Ia378bf0fb04ce33e3af24a2ce67778e89c41e31a Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>bb10
parent
2973413962
commit
264d54953e
|
|
@ -1076,9 +1076,7 @@ QDebug operator<<(QDebug dbg, const QJsonArray &a)
|
|||
#ifndef QT_NO_DATASTREAM
|
||||
QDataStream &operator<<(QDataStream &stream, const QJsonArray &array)
|
||||
{
|
||||
QJsonDocument doc{array};
|
||||
stream << doc.toJson(QJsonDocument::Compact);
|
||||
return stream;
|
||||
return stream << QJsonDocument{array};
|
||||
}
|
||||
|
||||
QDataStream &operator>>(QDataStream &stream, QJsonArray &array)
|
||||
|
|
|
|||
Loading…
Reference in New Issue