diff --git a/camp/campwizard.cpp b/camp/campwizard.cpp index 4593799..6cf951e 100644 --- a/camp/campwizard.cpp +++ b/camp/campwizard.cpp @@ -487,6 +487,11 @@ void CampWizard::on_btnPrint_clicked() filler.fill(report, m_data->id()); ReportViewer *viewer = new ReportViewer(this); + viewer->setAttribute(Qt::WA_DeleteOnClose); viewer->setReport(report); viewer->openPreview(); + + connect(viewer, &QDialog::finished, [this](int){ + this->accept(); + }); }