I am trying to render a QGraphicsScene
to an image using Qt5
using the following code:
QImage image(outputWidth, outputHeight, QImage::Format_ARGB32_Premultiplied);
QPainter painter(&image);
scene->render(&painter);
painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform);
image.mirrored().save("output.png");
The problem is that points that are too close to the boundary of the image are not rendered. Is there a way to enforce a padding/margin?