1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtCore module of the Qt Toolkit. |
7 ** This file is part of the QtCore module of the Qt Toolkit. |
8 ** |
8 ** |
154 read, then that number of bytes is read into the preallocated |
154 read, then that number of bytes is read into the preallocated |
155 \c{char *}; writeBytes() writes a quint32 containing the length of the |
155 \c{char *}; writeBytes() writes a quint32 containing the length of the |
156 data, followed by the data. Note that any encoding/decoding of |
156 data, followed by the data. Note that any encoding/decoding of |
157 the data (apart from the length quint32) must be done by you. |
157 the data (apart from the length quint32) must be done by you. |
158 |
158 |
|
159 \section1 Reading and writing Qt collection classes |
|
160 |
|
161 The Qt container classes can also be serialized to a QDataStream. |
|
162 These include QList, QLinkedList, QVector, QSet, QHash, and QMap. |
|
163 The stream operators are declared as non-members of the classes. |
|
164 |
159 \target Serializing Qt Classes |
165 \target Serializing Qt Classes |
160 \section1 Reading and writing other Qt classes. |
166 \section1 Reading and writing other Qt classes. |
161 |
167 |
162 In addition to the overloaded stream operators documented here, |
168 In addition to the overloaded stream operators documented here, |
163 any Qt classes that you might want to serialize to a QDataStream |
169 any Qt classes that you might want to serialize to a QDataStream |
590 You don't \e have to set a version if you are using the current |
596 You don't \e have to set a version if you are using the current |
591 version of Qt, but for your own custom binary formats we |
597 version of Qt, but for your own custom binary formats we |
592 recommend that you do; see \l{Versioning} in the Detailed |
598 recommend that you do; see \l{Versioning} in the Detailed |
593 Description. |
599 Description. |
594 |
600 |
595 In order to accommodate new functionality, the datastream |
601 To accommodate new functionality, the datastream serialization |
596 serialization format of some Qt classes has changed in some |
602 format of some Qt classes has changed in some versions of Qt. If |
597 versions of Qt. If you want to read data that was created by an |
603 you want to read data that was created by an earlier version of |
598 earlier version of Qt, or write data that can be read by a |
604 Qt, or write data that can be read by a program that was compiled |
599 program that was compiled with an earlier version of Qt, use this |
605 with an earlier version of Qt, use this function to modify the |
600 function to modify the serialization format used by QDataStream. |
606 serialization format used by QDataStream. |
601 |
607 |
602 \table |
608 \table |
603 \header \i Qt Version \i QDataStream Version |
609 \header \i Qt Version \i QDataStream Version |
|
610 \row \i Qt 4.6 \i 12 |
|
611 \row \i Qt 4.5 \i 11 |
604 \row \i Qt 4.4 \i 10 |
612 \row \i Qt 4.4 \i 10 |
605 \row \i Qt 4.3 \i 9 |
613 \row \i Qt 4.3 \i 9 |
606 \row \i Qt 4.2 \i 8 |
614 \row \i Qt 4.2 \i 8 |
607 \row \i Qt 4.0, 4.1 \i 7 |
615 \row \i Qt 4.0, 4.1 \i 7 |
608 \row \i Qt 3.3 \i 6 |
616 \row \i Qt 3.3 \i 6 |