Basically, you are looking at using QByteArray, and typecasting the output to some format.
http://qt-project.org/doc/qt-4.8/qbytearray.html#details
Another way to think about this, is you are taking some structure or type, turning it into a long string of ones and zeros, and then on the other end you are switching it back.
Hope that helps.