Starting /home/MALEK/soso-build-desktop/soso...
QPainter::begin: Paint device returned engine == 0, type: 2
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::worldTransform: Painter not active
QPainter::save: Painter not active
QPainter::setWorldTransform: Painter not active
QPainter::setOpacity: Painter not active
QPainter::setPen: Painter not active
QPainter::setBrush: Painter not active
QPainter::drawRects: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::setWorldTransform: Painter not active
QPainter::restore: Unbalanced save/restore
QPainter::end: Painter not active, aborted
/home/MALEK/soso-build-desktop/soso exited with code 0
Even When I use the code of the tutorial this msgs appears !!

I use this code
Qt Code:
  1. scene.addRect(QRectF(0, 0, 100, 200), QPen(Qt::black), QBrush(Qt::green));
  2.  
  3. QPixmap pixmap;
  4. QPainter painter(&pixmap);
  5. painter.setRenderHint(QPainter::Antialiasing);
  6. scene.render(&painter);
  7. painter.end();
  8.  
  9. pixmap.save("scene.png");
To copy to clipboard, switch view to plain text mode 

from this link:
http://doc.qt.nokia.com/4.6/graphicsview.html