title: Size of QByteArray is hard to compute?
body: <p>Recently I programmed to do file transmission with Qt. Thought it worked now, I'm still curious about what happened. Please help me find out the reason. Many thanks.</p>
  
  <p><strong>Why the size of head is bigger than the sum of sizeof(qin32), sizeof(qint32) and length of file name?(I guess it is the reason of function - setVersion())</strong></p>
  
  <pre><code>QFileInfo info(file_to_send.fileName());
  QByteArray head;
  QDataStream out(&amp;head, QIODevice::WriteOnly);
  out.setVersion(QDataStream::Qt_5_0);
  out &lt;&lt; qint32(file_to_send.size() + info.fileName().length() + sizeof(qint32)*2)
      &lt;&lt; qint32(info.fileName().length())
      &lt;&lt; info.fileName();
  tcpClient.write(head);
  </code></pre>