mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
df8107830e
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>
42 lines
943 B
C++
42 lines
943 B
C++
#ifndef PRINTLAYOUT_H
|
|
#define PRINTLAYOUT_H
|
|
|
|
#include <QObject>
|
|
#include <QPrinter>
|
|
#include <QList>
|
|
|
|
class PrintDialog;
|
|
class TablePrintModel;
|
|
struct dive;
|
|
|
|
class PrintLayout : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
PrintLayout(PrintDialog *, QPrinter *, struct options *);
|
|
void print();
|
|
|
|
private:
|
|
PrintDialog *dialog;
|
|
QPrinter *printer;
|
|
QPainter *painter;
|
|
struct options *printOptions;
|
|
|
|
int screenDpiX, screenDpiY, printerDpi, scaledPageW, scaledPageH;
|
|
qreal scaleX, scaleY;
|
|
QRect pageRect;
|
|
|
|
QList<QString> tablePrintColumnNames;
|
|
QList<unsigned int> tablePrintColumnWidths;
|
|
unsigned int tablePrintHeadingBackground;
|
|
|
|
void setup();
|
|
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;
|
|
|
|
QPixmap convertPixmapToGrayscale(QPixmap) const;
|
|
};
|
|
|
|
#endif
|