The QDataStream class allows you to serialize the Qt data types listed in this section.
It is always best to cast integers to a Qt integer type, such as qint16 or quint32 , when reading and writing. This ensures that you always know exactly what size integers you are reading and writing, no matter what the underlying platform and architecture the application happens to be running on.
float
double
const char *
另请参阅 在 Qt 中支持 JSON and 在 Qt 中支持 CBOR .