| Classes - Annotated - Tree - Functions - Home - Structure

# Format of the QDataStream operators

The QDataStream allows you to serialize some of the Qt data types. In the following table you find for these data types the format of the serialization.

Q_INT8

- signed byte

Q_INT16

- signed 16 bit integer

Q_INT32

- signed 32 bit integer

Q_UINT8

- unsigned byte

Q_UINT16

- unsigned 16 bit integer

Q_UINT32

- unsigned 32 bit integer

float

- 32-bit floating point number using the standard IEEE754 format

double

- 64-bit floating point number using the standard IEEE754 format

char*

1. The length of the string including the terminating 0 (Q_UINT32)
2. The string including the terminating 0, i.e. length bytes

QBrush

1. The brush style (Q_UINT8)
2. The brush color (QColor)
3. If style == `CustomPattern:` the brush pixmap (QPixmap)

QColor

- RGB value serialized as a Q_UINT32

QCursor

1. Shape id (Q_INT16)
2. If shape == `BitmapCursor:` bitmap (QPixmap)
3. If shape == `BitmapCursor:` mask (QPixmap)
4. If shape == `BitmapCursor:` hot spot (QPoint)

QFont

1. The point size (Q_INT16)
2. The style hint (Q_UINT8)
3. The char set (Q_UINT8)
4. The weight (Q_UINT8)
5. The font bits (Q_UINT8)

QImage

- Save it as a PNG image.

QColorGroup

1. foreground (QBrush)
2. button (QBrush)
3. light (QBrush)
4. midLight (QBrush)
5. dark (QBrush)
6. mid (QBrush)
7. text (QBrush)
8. brightText (QBrush)
9. ButtonText (QBrush)
10. base (QBrush)
11. background (QBrush)
12. shadow (QBrush)
13. highlight (QBrush)
14. highlightedText (QBrush)

QPalette

1. active (QColorGroup)
2. disabled (QColorGroup)
3. inactive (QColorGroup)

QPen

1. The pen style(s) (Q_UINT8)
2. The pen width (Q_UINT8)
3. The pen color (QColor)

QPixmap

- Save it as a PNG image.

QPoint

1. The x coordinate (Q_INT32)
2. The y coordinate (Q_INT32)

QPointArray

1. The array size (Q_UINT32)
2. The array points (QPoint)

QRect

1. left (Q_INT32)
2. top (Q_INT32)
3. right (Q_INT32)
4. bottom (Q_INT32)

QRegion

1. The size of the data, i.e. 8+16*(number of rectangles) (Q_UINT32)
2. QRGN_RECTS (Q_INT32)
3. The number of rectangles (Q_UINT32)
4. The rectangles in sequential order (QRect)

QSize

1. width (Q_INT32)
2. height (Q_INT32)

QVariant

1. The type of the data (Q_UINT32)
2. The data of the specified type

QWMatrix

1. m11 (double)
2. m12 (double)
3. m21 (double)
4. m22 (double)
5. dx (double)
6. dy (double)

QBitArray

1. The array size (Q_UINT32)
2. The array bits, i.e. (size+7)/8 bytes

QByteArray

1. The array size (Q_UINT32)
2. The array bytes, i.e. size bytes

QCString

1. The length (Q_UINT32)
2. The data, i.e. length bytes

QDate

- Julian day (Q_UINT32)

QTime

- Milliseconds since midnight (Q_UINT32)

QDateTime

1. Date (QDate)
2. Time (QTime)

QMap

1. The number of items (Q_UINT32)
2. For all items: the key and value

QString

1. If isNull():
   1. 0xffffffff (Q_UINT32)
2. Else:
   1. length (Q_UINT32)
   2. data in utf16

QValueList

1. The number of list elements (Q_UINT32)
2. All the elements in sequential order