diff options
-rw-r--r-- | printer.cpp | 7 | ||||
-rw-r--r-- | printer.h | 1 |
2 files changed, 7 insertions, 1 deletions
diff --git a/printer.cpp b/printer.cpp index f8a90f96d..446a5c29d 100644 --- a/printer.cpp +++ b/printer.cpp @@ -13,6 +13,12 @@ Printer::Printer(QPrinter *printer, print_options *printOptions, template_option this->templateOptions = templateOptions; dpi = 0; done = 0; + webView = new QWebView(); +} + +Printer::~Printer() +{ + delete webView; } void Printer::putProfileImage(QRect profilePlaceholder, QRect viewPort, QPainter *painter, struct dive *dive, QPointer<ProfileWidget2> profile) @@ -118,7 +124,6 @@ void Printer::templateProgessUpdated(int value) void Printer::print() { TemplateLayout t(printOptions, templateOptions); - webView = new QWebView(); connect(&t, SIGNAL(progressUpdated(int)), this, SLOT(templateProgessUpdated(int))); dpi = printer->resolution(); @@ -29,6 +29,7 @@ private slots: public: Printer(QPrinter *printer, print_options *printOptions, template_options *templateOptions); + ~Printer(); void print(); signals: |