mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
printing: move #includes from headers to source files
To decrease include-file interdependencies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2239ffe13c
commit
fa6eb6144b
10 changed files with 39 additions and 21 deletions
|
@ -55,9 +55,12 @@
|
|||
#include "profile-widget/profilewidget2.h"
|
||||
|
||||
#ifndef NO_PRINTING
|
||||
#include <QPrinter>
|
||||
#include <QPrintDialog>
|
||||
#include <QBuffer>
|
||||
#include "desktop-widgets/printdialog.h"
|
||||
#include "desktop-widgets/printer.h"
|
||||
#include "desktop-widgets/templatelayout.h"
|
||||
#endif
|
||||
|
||||
#include "qt-models/cylindermodel.h"
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "printdialog.h"
|
||||
#include "printoptions.h"
|
||||
#include "mainwindow.h"
|
||||
#include "printer.h"
|
||||
#include "core/pref.h"
|
||||
#include "core/dive.h" // for existing_filename
|
||||
|
||||
#ifndef NO_PRINTING
|
||||
#include <QProgressBar>
|
||||
#include <QPrinter>
|
||||
#include <QPrintPreviewDialog>
|
||||
#include <QPrintDialog>
|
||||
#include <QFileDialog>
|
||||
|
|
|
@ -4,11 +4,11 @@
|
|||
|
||||
#ifndef NO_PRINTING
|
||||
#include <QDialog>
|
||||
#include <QPrinter>
|
||||
#include "printoptions.h"
|
||||
#include "printer.h"
|
||||
#include "templateedit.h"
|
||||
#include "printoptions.h"
|
||||
|
||||
class Printer;
|
||||
class QPrinter;
|
||||
class QProgressBar;
|
||||
class PrintOptions;
|
||||
class PrintLayout;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "printer.h"
|
||||
#include "mainwindow.h"
|
||||
#include "templatelayout.h"
|
||||
#include "core/statistics.h"
|
||||
#include "core/qthelper.h"
|
||||
|
@ -7,6 +8,7 @@
|
|||
|
||||
#include <algorithm>
|
||||
#include <QPainter>
|
||||
#include <QPrinter>
|
||||
#include <QtWebKitWidgets>
|
||||
#include <QWebElementCollection>
|
||||
#include <QWebElement>
|
||||
|
@ -28,7 +30,8 @@ Printer::~Printer()
|
|||
delete webView;
|
||||
}
|
||||
|
||||
void Printer::putProfileImage(QRect profilePlaceholder, QRect viewPort, QPainter *painter, struct dive *dive, QPointer<ProfileWidget2> profile)
|
||||
void Printer::putProfileImage(const QRect &profilePlaceholder, const QRect &viewPort, QPainter *painter,
|
||||
struct dive *dive, QPointer<ProfileWidget2> profile)
|
||||
{
|
||||
int x = profilePlaceholder.x() - viewPort.x();
|
||||
int y = profilePlaceholder.y() - viewPort.y();
|
||||
|
|
|
@ -2,14 +2,15 @@
|
|||
#ifndef PRINTER_H
|
||||
#define PRINTER_H
|
||||
|
||||
#include <QPrinter>
|
||||
#include <QWebView>
|
||||
#include <QRect>
|
||||
#include <QPainter>
|
||||
|
||||
#include "printoptions.h"
|
||||
#include "templateedit.h"
|
||||
|
||||
class ProfileWidget2;
|
||||
class QPainter;
|
||||
class QPaintDevice;
|
||||
class QRect;
|
||||
class QWebView;
|
||||
|
||||
class Printer : public QObject {
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -30,7 +31,8 @@ private:
|
|||
int dpi;
|
||||
void render(int Pages);
|
||||
void flowRender();
|
||||
void putProfileImage(QRect box, QRect viewPort, QPainter *painter, struct dive *dive, QPointer<ProfileWidget2> profile);
|
||||
void putProfileImage(const QRect &box, const QRect &viewPort, QPainter *painter,
|
||||
struct dive *dive, QPointer<ProfileWidget2> profile);
|
||||
|
||||
private slots:
|
||||
void templateProgessUpdated(int value);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "printoptions.h"
|
||||
#include "templateedit.h"
|
||||
#include "templatelayout.h"
|
||||
#include "core/qthelper.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include "templateedit.h"
|
||||
#include "printoptions.h"
|
||||
#include "templatelayout.h"
|
||||
#include "printer.h"
|
||||
#include "ui_templateedit.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
#include <QButtonGroup>
|
||||
#include <QColorDialog>
|
||||
#include <QDir>
|
||||
|
||||
TemplateEdit::TemplateEdit(QWidget *parent, const print_options &printOptions, template_options &templateOptions) :
|
||||
QDialog(parent),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#define TEMPLATEEDIT_H
|
||||
|
||||
#include <QDialog>
|
||||
#include "templatelayout.h"
|
||||
#include "printoptions.h"
|
||||
|
||||
namespace Ui {
|
||||
class TemplateEdit;
|
||||
|
|
|
@ -1,11 +1,16 @@
|
|||
// SPDX-License-Identifier: GPL-2.0
|
||||
#include <QFileDevice>
|
||||
#include <QRegularExpression>
|
||||
#include <list>
|
||||
#include <QTextStream>
|
||||
|
||||
#include "templatelayout.h"
|
||||
#include "mainwindow.h"
|
||||
#include "printoptions.h"
|
||||
#include "core/divelist.h"
|
||||
#include "core/selection.h"
|
||||
#include "core/qthelper.h"
|
||||
#include "core/subsurface-qt/diveobjecthelper.h"
|
||||
#include "core/subsurface-qt/cylinderobjecthelper.h" // TODO: remove once grantlee supports Q_GADGET objects
|
||||
|
||||
QList<QString> grantlee_templates, grantlee_statistics_templates;
|
||||
|
||||
|
|
|
@ -2,13 +2,14 @@
|
|||
#ifndef TEMPLATELAYOUT_H
|
||||
#define TEMPLATELAYOUT_H
|
||||
|
||||
#include <QStringList>
|
||||
#include "mainwindow.h"
|
||||
#include "printoptions.h"
|
||||
#include "core/statistics.h"
|
||||
#include "core/qthelper.h"
|
||||
#include "core/subsurface-qt/diveobjecthelper.h"
|
||||
#include "core/subsurface-qt/cylinderobjecthelper.h" // TODO: remove once grantlee supports Q_GADGET objects
|
||||
#include <QStringList>
|
||||
|
||||
class DiveObjectHelperGrantlee;
|
||||
class CylinderObjectHelper;
|
||||
struct print_options;
|
||||
struct template_options;
|
||||
class QTextStream;
|
||||
|
||||
int getTotalWork(const print_options &printOptions);
|
||||
void find_all_templates();
|
||||
|
|
Loading…
Add table
Reference in a new issue