mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:03:24 +00:00
Prettier printing
Going through pixmaps for the profile was not needed and was making our prints look very pixelated. In Qt4, QWidget child classes are printed as bitmaps. So appart from changing the code to print the tables to use a QGraphicsView instead, there is nothing we can do, so the rest of the printing is still done as bitmaps. Signed-off-by: Patrick Valsecchi <patrick@thus.ch> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
29795ef574
commit
4f23ff144f
1 changed files with 9 additions and 8 deletions
|
@ -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++;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue