Hi,

I have large QGraphicsScene with large number of graphics object on it.
I want to export the scene as image (PNG) it is giving following errors:

Painter::begin: Paint device returned engine == 0, type: 3
QPainter::setRenderHint: Painter must be active to set rendering hints
QPainter::save: Painter not active
QPainter::setClipRect: Painter not active
QPainter::setWorldTransform: Painter not active
QPainter::save: Painter not active
QPainter::setBrushOrigin: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::opacity: Painter not active
QPainter::worldTransform: Painter not active

CODE:
Qt Code:
  1. QImage image(scene->sceneRect().width(), scene->sceneRect().height(), QImage::Format_ARGB4444_Premultiplied);
  2. QPainter painter(&image);
  3. painter.setRenderHint(QPainter::Antialiasing);
  4. scene->render(&painter);
  5. image.save(sFilePath);
To copy to clipboard, switch view to plain text mode 
But this works fine for the small scene with less no of graphics item on it.
So my queries are-

1. What does it mean by painter not active?
2. How to resolve the above problem?
3. Is it related to scene size and/or no. of graphics items on it?

It would be very helpful for me, if anyone answer the above queries or give any pointers to investigate the issue further.

Thanks!