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