title: Saving QPixmap to JPEG failing (Qt 4.5)
body: <p>I have the following code.</p>
  
  <pre><code>QString fileName = QFileDialog::getSaveFileName(
     this, 
     tr("Output Image file"),
     (""),
     tr("PNG (*.png);;JPEG (*.JPEG);;Windows Bitmap (*.bmp);;All Files (*.*)")
  );
  
  if(fileName != "")
  {
     QwtPlot* pPlot = ...
     QSize size = pPlot-&gt;size();
     QRect printingRect(QPoint(0, 0), size);
  
     QPixmap pixmapPrinter(size);
     pixmapPrinter.fill(Qt::white);
  
     {
        QPainter painter(&amp;pixmapPrinter); 
        pPlot-&gt;print(&amp;painter, printingRect);     
     } 
  
     bool isOk = pixmapPrinter.save(fileName);
  
     if(!isOk)
     {                
        QString msgText = tr("Failed to write into ") + fileName;
  
        QMessageBox::critical(this, tr("Error Writing"), msgText);
     }
  }
  </code></pre>
  
  <p>So, the path is like this: - File dialog pops up - users selects format and file - the system draws plot onto QPixmap - Saves QPixmap into the file.</p>
  
  <p>It works for PNG and BMP without a problem, but for JPEG, jpg, JPG, etc it fails.</p>
  
  <p>I was all over Qt documentation but could not find any details. It should just work.
  Any ideas?</p>
  
  <p>I am using Qt commercial edition, 4.5.1 for Windows.<br>
  I am using dlls, Qt is not on the path.</p>
  
  <p>I just realised that I am linking statically to a classical 3rd party jpeg.lib (The Independent JPEG Group's JPEG software), which is used by other library. </p>
  
  <p>Is it possible that a conflict or something arises because of this? </p>
  
  <p>Or it is simply that plugin is not loaded properly.</p>