title: Qt4: write QByteArray to file with filename?
body: <p>I'm having trouble in Qt 4 with writing to non-text files. I have a QByteArray data and I want to save it to a file with name "some_name.ext" in specific directory: "C://MyDir". How can I do this? Note that the content is not textual. </p>
  
  <p>The format is "GIF" and it is not supported by Qt. </p>
  
  <pre><code>QImage mainImage; 
  if (!mainImage.loadFromData(aPhoto.data)) 
      return false; 
  if (!mainImage.save(imageName, imageFormat.toUtf8().constData())) 
     return false; 
  </code></pre>
  
  <p>I want to bypass somehow that restriction!</p>