Bypass the PDF bug by painting on a QImage and paint the image to pdf

well... we have a good and working printing system now. :)

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2014-07-17 22:00:24 -03:00 committed by Dirk Hohndel
parent 10ed5da325
commit 94bcd2622a

View file

@ -193,10 +193,14 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
}
QTransform origTransform = painter.transform();
QImage image(scaledW, scaledH - tableH - padPT, QImage::Format_ARGB32);
QPainter imgPainter(&image);
// draw a profile
painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetProfile);
profile->plotDive(dive, true); // make sure the profile is actually redrawn
profile->render(&painter, QRect(0, 0, scaledW, scaledH - tableH - padPT));
profile->render(&imgPainter, QRect(0, 0, scaledW, scaledH - tableH - padPT));
imgPainter.end();
painter.drawImage(image.rect(),image);
painter.setTransform(origTransform);
// draw a table