mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 13:10:19 +00:00
9a99aa4c58
Currently only for the table print, but now we use the actual dive table to iterate trough all dives (find only selected if needed) and print their 'number' element in table rows. Also improves the new-page detection algorithm slightly. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
36 lines
633 B
C++
36 lines
633 B
C++
#ifndef PRINTLAYOUT_H
|
|
#define PRINTLAYOUT_H
|
|
|
|
#include <QPrinter>
|
|
#include <QPainter>
|
|
#include "../display.h"
|
|
|
|
class PrintDialog;
|
|
struct dive;
|
|
|
|
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;
|
|
|
|
void setup();
|
|
void printSixDives();
|
|
void printTwoDives();
|
|
void printTable();
|
|
QString insertTableHeadingRow();
|
|
QString insertTableDataRow(struct dive *dive);
|
|
};
|
|
|
|
#endif
|