ErrorDialog: Clear messages on close instead of hide
Fixes an issue where the error dialog is cleared because the hide event gets triggered.
This commit is contained in:
parent
d1b4736ef9
commit
bfb95d503a
@ -28,12 +28,11 @@
|
||||
#include <QStyle>
|
||||
#include <QLabel>
|
||||
#include <QTextEdit>
|
||||
#include <QCloseEvent>
|
||||
|
||||
#include "errordialog.h"
|
||||
#include "ui_errordialog.h"
|
||||
|
||||
class QHideEvent;
|
||||
|
||||
ErrorDialog::ErrorDialog(QWidget *parent)
|
||||
: QDialog(parent),
|
||||
ui_(new Ui_ErrorDialog) {
|
||||
@ -68,9 +67,13 @@ void ErrorDialog::ShowMessage(const QString &message) {
|
||||
|
||||
}
|
||||
|
||||
void ErrorDialog::hideEvent(QHideEvent *) {
|
||||
void ErrorDialog::closeEvent(QCloseEvent *e) {
|
||||
|
||||
current_messages_.clear();
|
||||
UpdateContent();
|
||||
|
||||
QDialog::closeEvent(e);
|
||||
|
||||
}
|
||||
|
||||
void ErrorDialog::UpdateContent() {
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
|
||||
class QHideEvent;
|
||||
class QCloseEvent;
|
||||
class Ui_ErrorDialog;
|
||||
|
||||
class ErrorDialog : public QDialog {
|
||||
@ -43,7 +43,7 @@ class ErrorDialog : public QDialog {
|
||||
void ShowMessage(const QString &message);
|
||||
|
||||
protected:
|
||||
void hideEvent(QHideEvent*) override;
|
||||
void closeEvent(QCloseEvent *e) override;
|
||||
|
||||
private:
|
||||
void UpdateContent();
|
||||
|
@ -75,7 +75,7 @@
|
||||
<sender>buttonbox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>ErrorDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>299</x>
|
||||
@ -91,7 +91,7 @@
|
||||
<sender>buttonbox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>ErrorDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<slot>close()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>299</x>
|
||||
|
Loading…
x
Reference in New Issue
Block a user