From 2482eba7dea7e6f5e5bc1e459a2c610908a596b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Thu, 19 Apr 2018 14:29:22 +0300 Subject: [PATCH] Do not allow closing ScanProgressDialog BUG: 393275 --- src/gui/scanprogressdialog.cpp | 9 ++++++++- src/gui/scanprogressdialog.h | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) 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; };