diff --git a/src/gui/scanprogressdialog.cpp b/src/gui/scanprogressdialog.cpp index da673f4..b14049e 100644 --- a/src/gui/scanprogressdialog.cpp +++ b/src/gui/scanprogressdialog.cpp @@ -18,6 +18,8 @@ #include "gui/scanprogressdialog.h" +#include + #include ScanProgressDialog::ScanProgressDialog(QWidget* parent) : @@ -30,6 +32,11 @@ ScanProgressDialog::ScanProgressDialog(QWidget* parent) : setAttribute(Qt::WA_ShowModal, true); } +void ScanProgressDialog::closeEvent(QCloseEvent* e) +{ + e->ignore(); +} + void ScanProgressDialog::setDeviceName(const QString& d) { if (d.isEmpty()) @@ -40,7 +47,7 @@ void ScanProgressDialog::setDeviceName(const QString& d) void ScanProgressDialog::showEvent(QShowEvent* e) { - setCancelButton(0); + setCancelButton(nullptr); QProgressDialog::showEvent(e); } diff --git a/src/gui/scanprogressdialog.h b/src/gui/scanprogressdialog.h index c3bbb93..327828d 100644 --- a/src/gui/scanprogressdialog.h +++ b/src/gui/scanprogressdialog.h @@ -15,8 +15,7 @@ * along with this program. If not, see .* *************************************************************************/ -#if !defined(SCANPROGRESSDIALOG_H) - +#ifndef SCANPROGRESSDIALOG_H #define SCANPROGRESSDIALOG_H #include @@ -34,6 +33,7 @@ public: void setDeviceName(const QString& d); protected: + void closeEvent(QCloseEvent* e) override; void showEvent(QShowEvent* e) override; };