Print: provide means for profile layouting

printlayout.cpp(h):

This patch cleans some test code and adds the function
printProfileDives() that accepts a number of dives
per rows and columns. It can technically fit any number
of dives on a page given the page size allows it. Both
landscape and portrait layouts are supported.

It now replaces the old methods:
printTwoDives()
printSixDives()

Space is reserved for data tables that will be placed
bellow profiles on a later stage.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Lubomir I. Ivanov 2013-09-27 19:06:45 +03:00 committed by Dirk Hohndel
parent e81bbc1dab
commit df8107830e
2 changed files with 45 additions and 32 deletions

View file

@ -19,9 +19,9 @@ public:
private:
PrintDialog *dialog;
QPrinter *printer;
QPainter *painter;
struct options *printOptions;
QPainter *painter;
int screenDpiX, screenDpiY, printerDpi, scaledPageW, scaledPageH;
qreal scaleX, scaleY;
QRect pageRect;
@ -31,8 +31,7 @@ private:
unsigned int tablePrintHeadingBackground;
void setup();
void printSixDives() const;
void printTwoDives() const;
void printProfileDives(int divesPerRow, int divesPerColumn);
void printTable();
void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const;
void addTablePrintHeadingRow(TablePrintModel *model, int row) const;