PDA

View Full Version : How do I get a Qpixmap or QImage from a QGraphicsView without show()+grabWidget()



maxpyne
15th June 2016, 01:26
I have tried following



QGraphicsView view;

QImager img;
QPainter painter(&img);
view.render(&painter);
painter,end();

img.save("./image.png");

Problem with this approach is that view does not update before rendering onto painter. Calling view.update() did not help either.
Any help is appreciated.

thanks

anda_skoa
15th June 2016, 08:36
Since you don't seem to need the view, have you tried rendering the scene itself instead?

Cheers,
_