title: Can't save PNG image into file
body: <p>I have some troubles with image saving. I have to crop "1.png" by rect and save it to file, but an empty one is appearing (0 bytes). What am I doing wrong?</p>
  
  <pre><code>void RedactorForm::cropButtonSlot(int x1, int y1, int x2, int y2) {
  
      QImage pixmap("1.png");
      QRect rect(x1,y1,x2,y2);
      pixmap=pixmap.copy(rect);
  
      QString fileName("D:/yourFile.png");
      QFile file(fileName);
      file.open(QIODevice::WriteOnly);
  
      QDataStream out(&amp;file);
      pixmap.save(fileName,0,100);
      out &lt;&lt;pixmap;
  }
  </code></pre>