1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
6 * Created on: Apr 28, 2014
9 #include <XGUI_ErrorDialog.h>
11 #include <QDialogButtonBox>
12 #include <QHBoxLayout>
14 #include <QVBoxLayout>
17 XGUI_ErrorDialog::XGUI_ErrorDialog(QWidget* parent)
20 QVBoxLayout* aDlgLay = new QVBoxLayout(this);
21 setWindowTitle(tr("Application errors"));
22 myErrorLog = new QTextEdit(this);
23 myErrorLog->setReadOnly(true);
24 aDlgLay->addWidget(myErrorLog);
25 QDialogButtonBox* aButtonBox = new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal,
27 aDlgLay->addWidget(aButtonBox);
28 aDlgLay->setContentsMargins(2, 2, 2, 2);
29 aDlgLay->setSpacing(2);
33 connect(aButtonBox, SIGNAL(accepted()), this, SLOT(clear()));
34 connect(aButtonBox, SIGNAL(rejected()), this, SLOT(clear()));
37 XGUI_ErrorDialog::~XGUI_ErrorDialog()
41 void XGUI_ErrorDialog::refresh()
44 foreach(QString eachError, myErrors)
46 myErrorLog->append(eachError);
50 void XGUI_ErrorDialog::clear()
57 void XGUI_ErrorDialog::addError(const QString& theError)
59 myErrors.append(theError);
68 void XGUI_ErrorDialog::removeError(const QString& theError)
70 myErrors.removeAll(theError);