Patch does: - set individual column width and name (held in tableColumnNames, tableColumnWidths) - reduce font size in the table - more small tweaks in the style sheet TODO: finish printing all dive data Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
40 lines
734 B
C++
40 lines
734 B
C++
#ifndef PRINTLAYOUT_H
|
|
#define PRINTLAYOUT_H
|
|
|
|
#include <QPrinter>
|
|
#include <QStringList>
|
|
|
|
class PrintDialog;
|
|
|
|
class PrintLayout : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
PrintLayout(PrintDialog *, QPrinter *, struct options *);
|
|
void print();
|
|
|
|
private:
|
|
PrintDialog *dialog;
|
|
QPrinter *printer;
|
|
struct options *printOptions;
|
|
|
|
QPainter *painter;
|
|
int screenDpiX, screenDpiY, printerDpi;
|
|
qreal scaleX, scaleY;
|
|
QRect pageRect;
|
|
|
|
QStringList tableColumnNames;
|
|
QStringList tableColumnWidths;
|
|
|
|
void setup();
|
|
void printSixDives();
|
|
void printTwoDives();
|
|
void printTable();
|
|
QString insertTableHeadingRow();
|
|
QString insertTableHeadingCol(int);
|
|
QString insertTableDataRow(struct dive *);
|
|
QString insertTableDataCol(QString);
|
|
};
|
|
|
|
#endif
|