1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/doc/datastreamformat.doc:36 -->
|
---|
3 | <html>
|
---|
4 | <head>
|
---|
5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
6 | <title>Format of the QDataStream Operators</title>
|
---|
7 | <style type="text/css"><!--
|
---|
8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
9 | a:link { color: #004faf; text-decoration: none }
|
---|
10 | a:visited { color: #672967; text-decoration: none }
|
---|
11 | body { background: #ffffff; color: black; }
|
---|
12 | --></style>
|
---|
13 | </head>
|
---|
14 | <body>
|
---|
15 |
|
---|
16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
17 | <tr bgcolor="#E5E5E5">
|
---|
18 | <td valign=center>
|
---|
19 | <a href="index.html">
|
---|
20 | <font color="#004faf">Home</font></a>
|
---|
21 | | <a href="classes.html">
|
---|
22 | <font color="#004faf">All Classes</font></a>
|
---|
23 | | <a href="mainclasses.html">
|
---|
24 | <font color="#004faf">Main Classes</font></a>
|
---|
25 | | <a href="annotated.html">
|
---|
26 | <font color="#004faf">Annotated</font></a>
|
---|
27 | | <a href="groups.html">
|
---|
28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
29 | | <a href="functions.html">
|
---|
30 | <font color="#004faf">Functions</font></a>
|
---|
31 | </td>
|
---|
32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>Format of the QDataStream Operators</h1>
|
---|
33 |
|
---|
34 |
|
---|
35 |
|
---|
36 | <p> The <a href="qdatastream.html">QDataStream</a> allows you to serialize some of the Qt data types.
|
---|
37 | The table below lists the data types that <a href="qdatastream.html">QDataStream</a> can serialize
|
---|
38 | and how they are represented.
|
---|
39 | <p> It is best to always cast integers to a Qt integer type when writing,
|
---|
40 | and to read back into the same Qt integer type when reading.
|
---|
41 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
42 | <tr bgcolor="#f0f0f0"> <td valign="top">Q_INT8
|
---|
43 | <td valign="top"><ul>
|
---|
44 | <li> signed byte
|
---|
45 | </ul>
|
---|
46 | <tr bgcolor="#d0d0d0"> <td valign="top">Q_INT16
|
---|
47 | <td valign="top"><ul>
|
---|
48 | <li> signed 16 bit integer
|
---|
49 | </ul>
|
---|
50 | <tr bgcolor="#f0f0f0"> <td valign="top">Q_INT32
|
---|
51 | <td valign="top"><ul>
|
---|
52 | <li> signed 32 bit integer
|
---|
53 | </ul>
|
---|
54 | <tr bgcolor="#d0d0d0"> <td valign="top">Q_UINT8
|
---|
55 | <td valign="top"><ul>
|
---|
56 | <li> unsigned byte
|
---|
57 | </ul>
|
---|
58 | <tr bgcolor="#f0f0f0"> <td valign="top">Q_UINT16
|
---|
59 | <td valign="top"><ul>
|
---|
60 | <li> unsigned 16 bit integer
|
---|
61 | </ul>
|
---|
62 | <tr bgcolor="#d0d0d0"> <td valign="top">Q_UINT32
|
---|
63 | <td valign="top"><ul>
|
---|
64 | <li> unsigned 32 bit integer
|
---|
65 | </ul>
|
---|
66 | <tr bgcolor="#f0f0f0"> <td valign="top">float
|
---|
67 | <td valign="top"><ul>
|
---|
68 | <li> 32-bit floating point number using the standard IEEE-754 format
|
---|
69 | </ul>
|
---|
70 | <tr bgcolor="#d0d0d0"> <td valign="top">double
|
---|
71 | <td valign="top"><ul>
|
---|
72 | <li> 64-bit floating point number using the standard IEEE-754 format
|
---|
73 | </ul>
|
---|
74 | <tr bgcolor="#f0f0f0"> <td valign="top">char *
|
---|
75 | <td valign="top"><ul>
|
---|
76 | <li> The size of the string including the terminating 0 (Q_UINT32)
|
---|
77 | <li> The string bytes including the terminating 0
|
---|
78 | </ul>
|
---|
79 | The null string is represented as <tt>(Q_UINT32) 0</tt>.
|
---|
80 | <tr bgcolor="#d0d0d0"> <td valign="top">QBitArray
|
---|
81 | <td valign="top"><ul>
|
---|
82 | <li> The array size (Q_UINT32)
|
---|
83 | <li> The array bits, i.e. (size + 7)/8 bytes
|
---|
84 | </ul>
|
---|
85 | <tr bgcolor="#f0f0f0"> <td valign="top">QBrush
|
---|
86 | <td valign="top"><ul>
|
---|
87 | <li> The brush style (Q_UINT8)
|
---|
88 | <li> The brush color (<a href="qcolor.html">QColor</a>)
|
---|
89 | <li> If style is CustomPattern, the brush pixmap (<a href="qpixmap.html">QPixmap</a>)
|
---|
90 | </ul>
|
---|
91 | <tr bgcolor="#d0d0d0"> <td valign="top">QByteArray
|
---|
92 | <td valign="top"><ul>
|
---|
93 | <li> The array size (Q_UINT32)
|
---|
94 | <li> The array bytes, i.e. size bytes
|
---|
95 | </ul>
|
---|
96 | <tr bgcolor="#f0f0f0"> <td valign="top">QCString
|
---|
97 | <td valign="top"><ul>
|
---|
98 | <li> The size of the string including the terminating 0 (Q_UINT32)
|
---|
99 | <li> The string bytes including the terminating 0
|
---|
100 | </ul>
|
---|
101 | The null string is represented as <tt>(Q_UINT32) 0</tt>.
|
---|
102 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="qcolor.html">QColor</a>
|
---|
103 | <td valign="top"><ul><li> RGB value serialized as a Q_UINT32 </ul>
|
---|
104 | <tr bgcolor="#f0f0f0"> <td valign="top">QColorGroup
|
---|
105 | <td valign="top"><ul>
|
---|
106 | <li> foreground (<a href="qbrush.html">QBrush</a>)
|
---|
107 | <li> button (QBrush)
|
---|
108 | <li> light (QBrush)
|
---|
109 | <li> midLight (QBrush)
|
---|
110 | <li> dark (QBrush)
|
---|
111 | <li> mid (QBrush)
|
---|
112 | <li> text (QBrush)
|
---|
113 | <li> brightText (QBrush)
|
---|
114 | <li> ButtonText (QBrush)
|
---|
115 | <li> base (QBrush)
|
---|
116 | <li> background (QBrush)
|
---|
117 | <li> shadow (QBrush)
|
---|
118 | <li> highlight (QBrush)
|
---|
119 | <li> highlightedText (QBrush)
|
---|
120 | </ul>
|
---|
121 | <tr bgcolor="#d0d0d0"> <td valign="top">QCursor
|
---|
122 | <td valign="top"><ul>
|
---|
123 | <li> Shape id (Q_INT16)
|
---|
124 | <li> If shape is BitmapCursor: The bitmap (<a href="qpixmap.html">QPixmap</a>), mask (QPixmap) and hot spot (<a href="qpoint.html">QPoint</a>)
|
---|
125 | </ul>
|
---|
126 | <tr bgcolor="#f0f0f0"> <td valign="top">QDate
|
---|
127 | <td valign="top"><ul>
|
---|
128 | <li> Julian day (Q_UINT32)
|
---|
129 | </ul>
|
---|
130 | <tr bgcolor="#d0d0d0"> <td valign="top">QDateTime
|
---|
131 | <td valign="top"><ul>
|
---|
132 | <li> Date (<a href="qdate.html">QDate</a>)
|
---|
133 | <li> Time (<a href="qtime.html">QTime</a>)
|
---|
134 | </ul>
|
---|
135 | <tr bgcolor="#f0f0f0"> <td valign="top">QFont
|
---|
136 | <td valign="top"><ul>
|
---|
137 | <li> The family (<a href="qcstring.html">QCString</a>)
|
---|
138 | <li> The point size (Q_INT16)
|
---|
139 | <li> The style hint (Q_UINT8)
|
---|
140 | <li> The char set (Q_UINT8)
|
---|
141 | <li> The weight (Q_UINT8)
|
---|
142 | <li> The font bits (Q_UINT8)
|
---|
143 | </ul>
|
---|
144 | <tr bgcolor="#d0d0d0"> <td valign="top">QImage
|
---|
145 | <td valign="top"><ul>
|
---|
146 | <li> If the image is null a "null image" marker is saved;
|
---|
147 | otherwise the image is saved in PNG or BMP format (depending
|
---|
148 | on the stream version). If you want control of the format,
|
---|
149 | stream the image into a <a href="qbuffer.html">QBuffer</a> (using <a href="qimageio.html">QImageIO</a>) and stream
|
---|
150 | that.
|
---|
151 | </ul>
|
---|
152 | <tr bgcolor="#f0f0f0"> <td valign="top">QMap
|
---|
153 | <td valign="top"><ul>
|
---|
154 | <li> The number of items (Q_UINT32)
|
---|
155 | <li> For all items, the key and value
|
---|
156 | </ul>
|
---|
157 | <tr bgcolor="#d0d0d0"> <td valign="top">QPalette
|
---|
158 | <td valign="top"><ul>
|
---|
159 | <li> active (<a href="qcolorgroup.html">QColorGroup</a>)
|
---|
160 | <li> disabled (QColorGroup)
|
---|
161 | <li> inactive (QColorGroup)
|
---|
162 | </ul>
|
---|
163 | <tr bgcolor="#f0f0f0"> <td valign="top">QPen
|
---|
164 | <td valign="top"><ul>
|
---|
165 | <li> The pen styles (Q_UINT8)
|
---|
166 | <li> The pen width (Q_UINT8)
|
---|
167 | <li> The pen color (<a href="qcolor.html">QColor</a>)
|
---|
168 | </ul>
|
---|
169 | <tr bgcolor="#d0d0d0"> <td valign="top">QPicture
|
---|
170 | <td valign="top"><ul>
|
---|
171 | <li> The size of the picture data (Q_UINT32)
|
---|
172 | <li> The raw bytes of picture data (char)
|
---|
173 | </ul>
|
---|
174 | <tr bgcolor="#f0f0f0"> <td valign="top">QPixmap
|
---|
175 | <td valign="top"><ul>
|
---|
176 | <li> Save it as a PNG image.
|
---|
177 | </ul>
|
---|
178 | <tr bgcolor="#d0d0d0"> <td valign="top">QPoint
|
---|
179 | <td valign="top"><ul>
|
---|
180 | <li> The x coordinate (Q_INT32)
|
---|
181 | <li> The y coordinate (Q_INT32)
|
---|
182 | </ul>
|
---|
183 | <tr bgcolor="#f0f0f0"> <td valign="top">QPointArray
|
---|
184 | <td valign="top"><ul>
|
---|
185 | <li> The array size (Q_UINT32)
|
---|
186 | <li> The array points (<a href="qpoint.html">QPoint</a>)
|
---|
187 | </ul>
|
---|
188 | <tr bgcolor="#d0d0d0"> <td valign="top">QRect
|
---|
189 | <td valign="top"><ul>
|
---|
190 | <li> left (Q_INT32)
|
---|
191 | <li> top (Q_INT32)
|
---|
192 | <li> right (Q_INT32)
|
---|
193 | <li> bottom (Q_INT32)
|
---|
194 | </ul>
|
---|
195 | <tr bgcolor="#f0f0f0"> <td valign="top">QRegion
|
---|
196 | <td valign="top"><ul>
|
---|
197 | <li> The size of the data, i.e. 8 + 16 * (number of rectangles) (Q_UINT32)
|
---|
198 | <li> QRGN_RECTS (Q_INT32)
|
---|
199 | <li> The number of rectangles (Q_UINT32)
|
---|
200 | <li> The rectangles in sequential order (<a href="qrect.html">QRect</a>)
|
---|
201 | </ul>
|
---|
202 | <tr bgcolor="#d0d0d0"> <td valign="top">QSize
|
---|
203 | <td valign="top"><ul>
|
---|
204 | <li> width (Q_INT32)
|
---|
205 | <li> height (Q_INT32)
|
---|
206 | </ul>
|
---|
207 | <tr bgcolor="#f0f0f0"> <td valign="top">QString
|
---|
208 | <td valign="top"><ul>
|
---|
209 | <li> If the string is null: 0xffffffff (Q_UINT32)<br>
|
---|
210 | otherwise: The string length (Q_UINT32) followed by the
|
---|
211 | data in UTF-16
|
---|
212 | </ul>
|
---|
213 | <tr bgcolor="#d0d0d0"> <td valign="top">QTime
|
---|
214 | <td valign="top"><ul>
|
---|
215 | <li> Milliseconds since midnight (Q_UINT32)
|
---|
216 | </ul>
|
---|
217 | <tr bgcolor="#f0f0f0"> <td valign="top">QValueList
|
---|
218 | <td valign="top"><ul>
|
---|
219 | <li> The number of list elements (Q_UINT32)
|
---|
220 | <li> All the elements in sequential order
|
---|
221 | </ul>
|
---|
222 | <tr bgcolor="#d0d0d0"> <td valign="top">QVariant
|
---|
223 | <td valign="top"><ul>
|
---|
224 | <li> The type of the data (Q_UINT32)
|
---|
225 | <li> The data of the specified type
|
---|
226 | </ul>
|
---|
227 | <tr bgcolor="#f0f0f0"> <td valign="top">QWMatrix
|
---|
228 | <td valign="top"><ul>
|
---|
229 | <li> m11 (double)
|
---|
230 | <li> m12 (double)
|
---|
231 | <li> m21 (double)
|
---|
232 | <li> m22 (double)
|
---|
233 | <li> dx (double)
|
---|
234 | <li> dy (double)
|
---|
235 | </ul>
|
---|
236 | </table></center>
|
---|
237 | <p>
|
---|
238 | <!-- eof -->
|
---|
239 | <p><address><hr><div align=center>
|
---|
240 | <table width=100% cellspacing=0 border=0><tr>
|
---|
241 | <td>Copyright © 2007
|
---|
242 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
243 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
244 | </table></div></address></body>
|
---|
245 | </html>
|
---|