Quote Originally Posted by Codepoet
You did not write a QString but instead a
Qt Code:
  1. const char *
To copy to clipboard, switch view to plain text mode 
This
Qt Code:
  1. outStream << QString("The beginning of a series of numbers");
To copy to clipboard, switch view to plain text mode 
should work. Or you could change the type you are trying to read out of the stream.
This worked just fine. It's interesting that they didn't mention this in the example that trolltech has in the 3.3 documentation for QDataStream.

http://doc.trolltech.com/3.3/qdatastream.html#details

Quote Originally Posted by Docs
Example (write binary data to a stream):

QFile file( "file.dat" );
file.open( IO_WriteOnly );
QDataStream stream( &file ); // we will serialize the data into the file
stream << "the answer is"; // serialize a string
stream << (Q_INT32)42; // serialize an integer


Example (read binary data from a stream):

QFile file( "file.dat" );
file.open( IO_ReadOnly );
QDataStream stream( &file ); // read the data serialized from the file
QString str;
Q_INT32 a;
stream >> str >> a; // extract "the answer is" and 42