OGS
OGSError.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "Base/OGSError.h"
5
6#include <QMessageBox>
7#include <QString>
8
9OGSError::OGSError() = default;
10
11OGSError::~OGSError() = default;
12
13void OGSError::box(const QString& e)
14{
15 box(e, "OpenGeoSys");
16}
17
18void OGSError::box(const QString& e, const QString& t)
19{
20 QMessageBox msgBox;
21 msgBox.setWindowTitle(t);
22 msgBox.setText(e);
23 msgBox.exec();
24}
25
26bool OGSError::question(const QString& e, const QString& t)
27{
28 QMessageBox msgBox;
29 msgBox.setWindowTitle(t);
30 msgBox.setText(e);
31 msgBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
32 msgBox.setDefaultButton(QMessageBox::Cancel);
33
34 return msgBox.exec() == QMessageBox::Ok;
35}
static void box(const QString &e)
Definition OGSError.cpp:13
static bool question(const QString &e, const QString &t)
Definition OGSError.cpp:26