4 * Created on: Apr 28, 2014
7 #include <XGUI_ErrorDialog.h>
9 #include <QDialogButtonBox>
10 #include <QHBoxLayout>
12 #include <QVBoxLayout>
15 XGUI_ErrorDialog::XGUI_ErrorDialog(QWidget* parent)
18 QVBoxLayout* aDlgLay = new QVBoxLayout(this);
19 setWindowTitle(tr("Application errors"));
20 myErrorLog = new QTextEdit(this);
21 myErrorLog->setReadOnly(true);
22 aDlgLay->addWidget(myErrorLog);
23 QDialogButtonBox* aButtonBox =
24 new QDialogButtonBox(QDialogButtonBox::Close, Qt::Horizontal, this);
25 aDlgLay->addWidget(aButtonBox);
26 aDlgLay->setContentsMargins(2,2,2,2);
27 aDlgLay->setSpacing(2);
31 connect(aButtonBox, SIGNAL(accepted()), this, SLOT(clear()));
32 connect(aButtonBox, SIGNAL(rejected()), this, SLOT(clear()));
35 XGUI_ErrorDialog::~XGUI_ErrorDialog()
39 void XGUI_ErrorDialog::refresh()
42 foreach(QString eachError, myErrors)
44 myErrorLog->append(eachError);
48 void XGUI_ErrorDialog::clear()
55 void XGUI_ErrorDialog::addError(const QString& theError)
57 myErrors.append(theError);
61 void XGUI_ErrorDialog::removeError(const QString& theError)
63 myErrors.removeAll(theError);