mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-01 06:30:26 +00:00
28b8d177c3
I can't really see any point in passing a local loop variable around, and copying a uninitialized pointer. Better use local variables there and let the compiler optimize them away if it feels for doing that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
48 lines
1.1 KiB
C++
48 lines
1.1 KiB
C++
#ifndef PRINTLAYOUT_H
|
|
#define PRINTLAYOUT_H
|
|
|
|
#include <QObject>
|
|
#include <QPrinter>
|
|
#include <QList>
|
|
|
|
class QTableView;
|
|
class PrintDialog;
|
|
class TablePrintModel;
|
|
class ProfilePrintModel;
|
|
struct dive;
|
|
|
|
class PrintLayout : public QObject {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
PrintLayout(PrintDialog *, QPrinter *, struct options *);
|
|
void print();
|
|
|
|
private:
|
|
PrintDialog *dialog;
|
|
QPrinter *printer;
|
|
struct options *printOptions;
|
|
|
|
int screenDpiX, screenDpiY, printerDpi, scaledPageW, scaledPageH;
|
|
qreal scaleX, scaleY;
|
|
QRect pageRect;
|
|
|
|
QList<QString> tablePrintColumnNames;
|
|
unsigned int tablePrintHeadingBackground;
|
|
QList<unsigned int> tablePrintColumnWidths;
|
|
unsigned int profilePrintTableMaxH;
|
|
QList<unsigned int> profilePrintColumnWidths, profilePrintRowHeights;
|
|
|
|
void setup();
|
|
int estimateTotalDives() const;
|
|
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;
|
|
|
|
signals:
|
|
void signalProgress(int);
|
|
};
|
|
|
|
#endif
|