OGS
AddLayerToMeshDialog.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 "
AddLayerToMeshDialog.h
"
5
6
#include "
Base/OGSError.h
"
7
#include "
Base/StrictDoubleValidator.h
"
8
9
AddLayerToMeshDialog::AddLayerToMeshDialog
(QDialog* parent) : QDialog(parent)
10
{
11
setupUi(
this
);
12
13
auto
* thickness_validator =
new
StrictDoubleValidator
(0, 1000000, 7,
this
);
14
this->thicknessEdit->setValidator(thickness_validator);
15
}
16
17
void
AddLayerToMeshDialog::accept
()
18
{
19
if
(this->nameEdit->text().isEmpty())
20
{
21
OGSError::box
(
"Please enter a name for the new Mesh."
);
22
}
23
else
if
(this->thicknessEdit->text().isEmpty() ||
24
this->thicknessEdit->text().toDouble() <= 0)
25
{
26
OGSError::box
(
"Thickness needs to be larger 0"
);
27
}
28
else
29
{
30
this->done(QDialog::Accepted);
31
}
32
}
33
34
void
AddLayerToMeshDialog::reject
()
35
{
36
this->done(QDialog::Rejected);
37
}
AddLayerToMeshDialog.h
OGSError.h
StrictDoubleValidator.h
AddLayerToMeshDialog::accept
void accept() override
Instructions if the OK-Button has been pressed.
Definition
AddLayerToMeshDialog.cpp:17
AddLayerToMeshDialog::AddLayerToMeshDialog
AddLayerToMeshDialog(QDialog *parent=nullptr)
Definition
AddLayerToMeshDialog.cpp:9
AddLayerToMeshDialog::reject
void reject() override
Instructions if the Cancel-Button has been pressed.
Definition
AddLayerToMeshDialog.cpp:34
OGSError::box
static void box(const QString &e)
Definition
OGSError.cpp:13
StrictDoubleValidator
A validator for an input field which only accepts decimals. Source code adapted from StackOverflow
Definition
StrictDoubleValidator.h:13
Applications
DataExplorer
DataView
AddLayerToMeshDialog.cpp
Generated by
1.14.0