aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/printlayout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/printlayout.cpp')
-rw-r--r--qt-ui/printlayout.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp
index 76c33a330..f539c89b3 100644
--- a/qt-ui/printlayout.cpp
+++ b/qt-ui/printlayout.cpp
@@ -162,18 +162,19 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
printer->newPage();
}
}
+ QTransform origTransform = painter.transform();
+
// draw a profile
+ painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetProfile);
profile->plot(dive, true);
- QPixmap profilePm = QPixmap::grabWidget(profile); // Qt4
- painter.drawPixmap((scaledW + padW) * col,
- (scaledH + padH) * row + yOffsetProfile,
- profilePm);
+ profile->render(&painter, QRect(0, 0, scaledW, scaledH - tableH - padPT));
+ painter.setTransform(origTransform);
+
// draw a table
+ painter.translate((scaledW + padW) * col, (scaledH + padH) * row + yOffsetTable);
model.setDive(dive);
- QPixmap tablePm = QPixmap::grabWidget(table); // Qt4
- painter.drawPixmap((scaledW + padW) * col,
- (scaledH + padH) * row + yOffsetTable,
- tablePm);
+ table->render(&painter);
+ painter.setTransform(origTransform);
col++;
}