From e727b899a633a6c7eaf075dcf7380aadd6f85b7f Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Thu, 3 Oct 2013 17:50:40 +0300 Subject: Print: provide means to print profile tables This patch adds a couple of classes and some other modifications in PrintLayout that handle the printing of tables under a profile. models.h : ProfilePrintModel The class uses a 'struct *dive' to output all required data for a certain dive at specific rows and columns. It also handles font formatting and text alignment. modeldelagatates.h : ProfilePrintDelegate The class is used only for drawing a custom grid for profile tables. PrintLayout::createProfileTable() The function is used to create and setup the profile table object PrintLayout::printProfileDives() The function now has correct padding of dive profiles on a page and also the printing of actual tables below them. Signed-off-by: Lubomir I. Ivanov Signed-off-by: Dirk Hohndel --- qt-ui/printlayout.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'qt-ui/printlayout.h') diff --git a/qt-ui/printlayout.h b/qt-ui/printlayout.h index 79c1d658e..a1f348664 100644 --- a/qt-ui/printlayout.h +++ b/qt-ui/printlayout.h @@ -5,8 +5,10 @@ #include #include +class QTableView; class PrintDialog; class TablePrintModel; +class ProfilePrintModel; struct dive; class PrintLayout : public QObject { @@ -19,7 +21,6 @@ public: private: PrintDialog *dialog; QPrinter *printer; - QPainter *painter; struct options *printOptions; int screenDpiX, screenDpiY, printerDpi, scaledPageW, scaledPageH; @@ -27,11 +28,14 @@ private: QRect pageRect; QList tablePrintColumnNames; - QList tablePrintColumnWidths; unsigned int tablePrintHeadingBackground; + QList tablePrintColumnWidths; + unsigned int profilePrintTableMaxH; + QList profilePrintColumnWidths, profilePrintRowHeights; void setup(); void printProfileDives(int divesPerRow, int divesPerColumn); + QTableView *createProfileTable(ProfilePrintModel *model, const int tableW); void printTable(); void addTablePrintDataRow(TablePrintModel *model, int row, struct dive *dive) const; void addTablePrintHeadingRow(TablePrintModel *model, int row) const; -- cgit v1.2.3-70-g09d2