Hi All,

My application consists of QGraphicsView/Scene nad I have added QGraphicsItems of different shapes line rectangle, circle etc. etc.
I want to convernt whatever is in QGraphicsScene to image file (e.g. scene.png).
Can you tell how to do this ???
I have tried following code
Qt Code:
  1.  
  2. scene->addItem(rectItem);
  3. scene->addItem(rectItem);
  4. //.....
  5.  
  6. QImage img(1024,768,QImage::Format_ARGB32_Premultiplied);
  7. QPainter p(&img);
  8. scene.render(&p);
  9. p.end();
  10. img.save("scene.png");
To copy to clipboard, switch view to plain text mode 
But above code only creates png file with background image (which I draw in
QGraphicsScene:drawBackground(QPainter * painter, QRectF const & /*clip*/) { } method using QPainterPath class.
The items which I added doesnt get added in png file.
Can you anybody tell me what I am missing ??

Thanks in advance.
Nilesh