Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

Format of the TQDataStream Operators

The TQDataStream allows you to serialize some of the TQt data types. The table below lists the data types that TQDataStream can serialize and how they are represented.

It is best to always cast integers to a TQt integer type when writing, and to read back into the same TQt integer type when reading.

TQ_INT8
  • signed byte
TQ_INT16
  • signed 16 bit integer
TQ_INT32
  • signed 32 bit integer
TQ_UINT8
  • unsigned byte
TQ_UINT16
  • unsigned 16 bit integer
TQ_UINT32
  • unsigned 32 bit integer
float
  • 32-bit floating point number using the standard IEEE-754 format
double
  • 64-bit floating point number using the standard IEEE-754 format
char *
  • The size of the string including the terminating 0 (TQ_UINT32)
  • The string bytes including the terminating 0
The null string is represented as (TQ_UINT32) 0.
TQBitArray
  • The array size (TQ_UINT32)
  • The array bits, i.e. (size + 7)/8 bytes
TQBrush
  • The brush style (TQ_UINT8)
  • The brush color (TQColor)
  • If style is CustomPattern, the brush pixmap (TQPixmap)
TQByteArray
  • The array size (TQ_UINT32)
  • The array bytes, i.e. size bytes
TQCString
  • The size of the string including the terminating 0 (TQ_UINT32)
  • The string bytes including the terminating 0
The null string is represented as (TQ_UINT32) 0.
TQColor
  • RGB value serialized as a TQ_UINT32
TQColorGroup
  • foreground (TQBrush)
  • button (TQBrush)
  • light (TQBrush)
  • midLight (TQBrush)
  • dark (TQBrush)
  • mid (TQBrush)
  • text (TQBrush)
  • brightText (TQBrush)
  • ButtonText (TQBrush)
  • base (TQBrush)
  • background (TQBrush)
  • shadow (TQBrush)
  • highlight (TQBrush)
  • highlightedText (TQBrush)
TQCursor
  • Shape id (TQ_INT16)
  • If shape is BitmapCursor: The bitmap (TQPixmap), mask (TQPixmap) and hot spot (TQPoint)
TQDate
  • Julian day (TQ_UINT32)
TQDateTime
TQFont
  • The family (TQCString)
  • The point size (TQ_INT16)
  • The style hint (TQ_UINT8)
  • The char set (TQ_UINT8)
  • The weight (TQ_UINT8)
  • The font bits (TQ_UINT8)
TQImage
  • 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 TQBuffer (using TQImageIO) and stream that.
TQMap
  • The number of items (TQ_UINT32)
  • For all items, the key and value
TQPalette
  • active (TQColorGroup)
  • disabled (TQColorGroup)
  • inactive (TQColorGroup)
TQPen
  • The pen styles (TQ_UINT8)
  • The pen width (TQ_UINT8)
  • The pen color (TQColor)
TQPicture
  • The size of the picture data (TQ_UINT32)
  • The raw bytes of picture data (char)
TQPixmap
  • Save it as a PNG image.
TQPoint
  • The x coordinate (TQ_INT32)
  • The y coordinate (TQ_INT32)
TQPointArray
  • The array size (TQ_UINT32)
  • The array points (TQPoint)
TQRect
  • left (TQ_INT32)
  • top (TQ_INT32)
  • right (TQ_INT32)
  • bottom (TQ_INT32)
TQRegion
  • The size of the data, i.e. 8 + 16 * (number of rectangles) (TQ_UINT32)
  • TQRGN_RECTS (TQ_INT32)
  • The number of rectangles (TQ_UINT32)
  • The rectangles in sequential order (TQRect)
TQSize
  • width (TQ_INT32)
  • height (TQ_INT32)
TQString
  • If the string is null: 0xffffffff (TQ_UINT32)
    otherwise: The string length (TQ_UINT32) followed by the data in UTF-16
TQTime
  • Milliseconds since midnight (TQ_UINT32)
TQValueList
  • The number of list elements (TQ_UINT32)
  • All the elements in sequential order
TQVariant
  • The type of the data (TQ_UINT32)
  • The data of the specified type
TQWMatrix
  • m11 (double)
  • m12 (double)
  • m21 (double)
  • m22 (double)
  • dx (double)
  • dy (double)


Copyright © 2007 TrolltechTrademarks
TQt 3.3.8