title: QDataStream and sending & receiving structures over QTcpSocket
body: <p>I am confused on how should I receive and send structures over a QTcp Socket.</p>
  
  <pre><code>in.startTransaction();
  
  QBytearray data;
  in &gt;&gt; data;
  
  if (!in.commitTransaction())
  {
      qDebug()  &lt;&lt; "incomplete: " &lt;&lt; data;
      return;
  }
  </code></pre>
  
  <p>so say my packet looks like this in bytes (01 00 00 68 65 6c 6c 6f )</p>
  
  <p>build my struct then use qdatastream operators to deserialize or serialize the packet data....</p>
  
  <p>what do i do about padding...</p>
  
  <p>some exaxmples would be helpfull</p>