aboutsummaryrefslogtreecommitdiffstats
path: root/qt-ui/templateedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qt-ui/templateedit.cpp')
-rw-r--r--qt-ui/templateedit.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp
index 0a8c4ca92..19f5db609 100644
--- a/qt-ui/templateedit.cpp
+++ b/qt-ui/templateedit.cpp
@@ -1,5 +1,6 @@
#include "templateedit.h"
#include "printoptions.h"
+#include "printer.h"
#include "ui_templateedit.h"
#include <QMessageBox>
@@ -27,6 +28,14 @@ TemplateEdit::TemplateEdit(QWidget *parent, struct print_options *printOptions,
}
ui->plainTextEdit->setPlainText(grantlee_template);
+
+ int width = ui->label->width();
+ int height = ui->label->height();
+ QPixmap map(width * 2, height * 2);
+ map.fill(QColor::fromRgb(255, 255, 255));
+ Printer printer(&map, printOptions, templateOptions, Printer::PREVIEW);
+ printer.previewOnePage();
+ ui->label->setPixmap(map.scaled(width, height, Qt::IgnoreAspectRatio));
}
TemplateEdit::~TemplateEdit()