Hi.

I have a problem saving a QImage.
It is generated from a QGraphicsScene via the following code:

Qt Code:
  1. QImage image(_scene->sceneRect().size().toSize(), QImage::Format_RGB32);
  2. QPainter painter(&image);
  3. _scene->render(&painter);
  4. image.save(filename);
To copy to clipboard, switch view to plain text mode 

_scene is a QGraphicsScene*
and filename is a non empty string with the format("filename.png")

image.save(filename) always return false.

Another place in my program I save a QImage generated by setting individual pixels in the QImage and that works fine. (The format here is also .png)

I have tried different formats by changing the filename from filename.png to filename.tiff and so on.

Any ideas?