OGS
OGSError.cpp
Go to the documentation of this file.
1
14#include "Base/OGSError.h"
15
16#include <QMessageBox>
17#include <QString>
18
19OGSError::OGSError() = default;
20
21OGSError::~OGSError() = default;
22
23void OGSError::box(const QString& e)
24{
25 box(e, "OpenGeoSys");
26}
27
28void OGSError::box(const QString& e, const QString& t)
29{
30 QMessageBox msgBox;
31 msgBox.setWindowTitle(t);
32 msgBox.setText(e);
33 msgBox.exec();
34}
35
36bool OGSError::question(const QString& e, const QString& t)
37{
38 QMessageBox msgBox;
39 msgBox.setWindowTitle(t);
40 msgBox.setText(e);
41 msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
42 msgBox.setDefaultButton(QMessageBox::Cancel);
43
44 return msgBox.exec() == QMessageBox::Ok;
45}
Definition of the OGSError class.
static void box(const QString &e)
Definition OGSError.cpp:23
static bool question(const QString &e, const QString &t)
Definition OGSError.cpp:36