PDA

View Full Version : QGraphicsScene render() crashes



iebele
29th April 2008, 13:38
Hi All,
This is my first post to this community. I am an artist from the Netherlands and I use Qt for some graphical things I need for my work.
At this moment I write a little application that places various QPixmap items in a QGraphicsScene (scene).
When I want to write te result to an image file, I first render the scene to a previous created image (a QImage). The program however crashes at the last line in the code below. Does anyone knows why?



image = image.scaled( scene->itemsBoundingRect ().width() ,
scene->itemsBoundingRect ().height() );

// create a painter
QPainter * painter = new QPainter( &image );
// program crashes after next line
scene->render( painter );