title: Ensure all the bytes are properly written to file
body: <p>Is it possible to check if all the bytes are actually being written on a QFile or not? Currently this is all I have</p>
  
  <pre><code>QFile f(name);
  if (f.open(QIODevice::WriteOnly)){
       f.write(bytes);
  }
  </code></pre>
  
  <p><code>bytes</code> has a size of 1MB and there are times when the entire chunk is not written to file, hence I end up getting a corrupted file.</p>