summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-17 22:00:24 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-18 10:14:48 -0700
commit94bcd2622a386172ea1150e16cf4628eb78a3760 (patch)
tree17fff8d3a42270bddafabcdd0521adff127cd3b8
parent10ed5da32565e48df0f429695416127b3007c0de (diff)
downloadsubsurface-94bcd2622a386172ea1150e16cf4628eb78a3760.tar.gz
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>
-rw-r--r--qt-ui/printlayout.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp
index 384a0efd2..c8e16213c 100644
--- a/qt-ui/printlayout.cpp
+++ b/qt-ui/printlayout.cpp
@@ -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