diff options
Diffstat (limited to 'qt-ui/templateedit.cpp')
-rw-r--r-- | qt-ui/templateedit.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/qt-ui/templateedit.cpp b/qt-ui/templateedit.cpp index 2d09cb947..bd4763107 100644 --- a/qt-ui/templateedit.cpp +++ b/qt-ui/templateedit.cpp @@ -29,7 +29,16 @@ TemplateEdit::TemplateEdit(QWidget *parent, struct print_options *printOptions, } ui->plainTextEdit->setPlainText(grantlee_template); + updatePreview(); +} + +TemplateEdit::~TemplateEdit() +{ + delete ui; +} +void TemplateEdit::updatePreview() +{ int width = ui->label->width(); int height = ui->label->height(); QPixmap map(width * 2, height * 2); @@ -39,11 +48,6 @@ TemplateEdit::TemplateEdit(QWidget *parent, struct print_options *printOptions, ui->label->setPixmap(map.scaled(width, height, Qt::IgnoreAspectRatio)); } -TemplateEdit::~TemplateEdit() -{ - delete ui; -} - void TemplateEdit::on_fontsize_valueChanged(int font_size) { newTemplateOptions.font_size = font_size; @@ -90,6 +94,7 @@ void TemplateEdit::on_buttonBox_clicked(QAbstractButton *button) break; case QDialogButtonBox::Apply: saveSettings(); + updatePreview(); break; } } |