Serialization features in qt
Solved
General and Desktop
-
Hi
yes
Qt can stream most of its own types directly - but this is in binary format via
https://doc.qt.io/qt-5/qdatastream.htmlIt cant save to XML but QDatastreams is both faster and more compact.
-
@IknowQT
Did you look at the sample code fragments on the documentation page? That's all there is to it.In addition to XML serialization, C#/.NET also has binary serializiation, through
System.Runtime.Serialization.Formatters.Binary
. That is what Qt'sQDataStream
is equivalent to. Alternatively, don't forget that Qt has support for JSON serialization. -
Hi,
In addition to my fellows:
QXmlStreamReader and QXmlStreamWriter.One important thing: all tools suggested until now won't serialize your objects automagically for you.