In case somebody will need it.
QImage out
(image.
width(), image.
height(),
QImage::Format_ARGB32);
out.fill(Qt::transparent);
pen.setColor(Qt::darkGray);
pen.setJoinStyle(Qt::RoundJoin);
painter.setBrush(brush);
painter.setPen(pen);
painter.drawRoundedRect(0, 0, image.width(), image.height(), 20, 20);
out.save("image.png", "PNG", 100);
QImage image("image.png");
QImage out(image.width(), image.height(), QImage::Format_ARGB32);
out.fill(Qt::transparent);
QBrush brush(image);
QPen pen;
pen.setColor(Qt::darkGray);
pen.setJoinStyle(Qt::RoundJoin);
QPainter painter(&out);
painter.setBrush(brush);
painter.setPen(pen);
painter.drawRoundedRect(0, 0, image.width(), image.height(), 20, 20);
out.save("image.png", "PNG", 100);
To copy to clipboard, switch view to plain text mode
Bookmarks