mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Print: allow optional table on top of profile
Patch enables the 'Profile on top' / 'Notes on top' functionality in the print options dialog. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
8ba5423e65
commit
edd2db6886
1 changed files with 8 additions and 2 deletions
|
@ -139,6 +139,12 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||||
const int tableH = profilePrintTableMaxH;
|
const int tableH = profilePrintTableMaxH;
|
||||||
// resize the profile widget
|
// resize the profile widget
|
||||||
profile->resize(scaledW, scaledH - tableH - padPT);
|
profile->resize(scaledW, scaledH - tableH - padPT);
|
||||||
|
// offset table or profile on top
|
||||||
|
int yOffsetProfile = 0, yOffsetTable = 0;
|
||||||
|
if (printOptions->notes_up)
|
||||||
|
yOffsetProfile = tableH + padPT;
|
||||||
|
else
|
||||||
|
yOffsetTable = scaledH - tableH;
|
||||||
|
|
||||||
// plot the dives at specific rows and columns on the page
|
// plot the dives at specific rows and columns on the page
|
||||||
int i, row = 0, col = 0;
|
int i, row = 0, col = 0;
|
||||||
|
@ -158,13 +164,13 @@ void PrintLayout::printProfileDives(int divesPerRow, int divesPerColumn)
|
||||||
profile->plot(dive, true);
|
profile->plot(dive, true);
|
||||||
QPixmap profilePm = QPixmap::grabWidget(profile); // Qt4
|
QPixmap profilePm = QPixmap::grabWidget(profile); // Qt4
|
||||||
painter.drawPixmap((scaledW + padW) * col,
|
painter.drawPixmap((scaledW + padW) * col,
|
||||||
(scaledH + padH) * row,
|
(scaledH + padH) * row + yOffsetProfile,
|
||||||
profilePm);
|
profilePm);
|
||||||
// draw a table
|
// draw a table
|
||||||
model.setDive(dive);
|
model.setDive(dive);
|
||||||
QPixmap tablePm = QPixmap::grabWidget(table); // Qt4
|
QPixmap tablePm = QPixmap::grabWidget(table); // Qt4
|
||||||
painter.drawPixmap((scaledW + padW) * col,
|
painter.drawPixmap((scaledW + padW) * col,
|
||||||
(scaledH + padH) * row + (scaledH - tableH),
|
(scaledH + padH) * row + yOffsetTable,
|
||||||
tablePm);
|
tablePm);
|
||||||
col++;
|
col++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue