Hi,

I'm exporting a QGraphicsView to various file formats: actually pdf and the image formats supported by QImage. My problem is that I loose my items transparency when exporting to pdf although the code is very similar.
Here is the image export code:
Qt Code:
  1. QImage image(size, QImage::Format_ARGB32_Premultiplied);
  2. image.fill( view->backgroundBrush().color().rgba() );
  3. paintOnDevice (&image, view);
  4. image.save( fileName );
To copy to clipboard, switch view to plain text mode 
and here is the pdf export
Qt Code:
  1. QPrinter printer (QPrinter::HighResolution);
  2. printer.setOutputFileName( QString(fileName) );
  3. printer.setOutputFormat( QPrinter::PdfFormat );
  4. printer.setPaperSize( size , QPrinter::Point );
  5. paintOnDevice (&printer, view);
To copy to clipboard, switch view to plain text mode 
where paintOnDevice is simply:
Qt Code:
  1. QPainter painter(device);
  2. painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing | QPainter::SmoothPixmapTransform);
  3. view->render( &painter );
  4. painter.end();
To copy to clipboard, switch view to plain text mode 
and where view is a QGraphicsView pointer.

I'm using Qt 4.7.0 and I get the same results on Mac OS X and Ubuntu Maverick 64bits. On windows, I'm using an older version (4.6.2) but I get the same results.
Any help would be appreciated
--
Dominique