#include <add_trappy_line_form.h>
|
Ui::AddTrappyLineForm * | ui |
|
◆ AddTrappyLineForm()
AddTrappyLineForm::AddTrappyLineForm |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
8 : QDialog(parent),
ui(
new Ui::AddTrappyLineForm) {
10 QDoubleValidator* double_validator{new QDoubleValidator()};
11 ui->firstPointAbscissaLineEdit->setValidator(double_validator);
12 ui->firstPointOrdinateLineEdit->setValidator(double_validator);
13 ui->secondPointAbscissaLineEdit->setValidator(double_validator);
14 ui->secondPointOrdinateLineEdit->setValidator(double_validator);
15}
◆ ~AddTrappyLineForm()
AddTrappyLineForm::~AddTrappyLineForm |
( |
| ) |
|
◆ AddTrappyLine
void AddTrappyLineForm::AddTrappyLine |
( |
double | x1, |
|
|
double | y1, |
|
|
double | x2, |
|
|
double | y2 ) |
|
signal |
◆ on_clearPushButton_clicked
void AddTrappyLineForm::on_clearPushButton_clicked |
( |
| ) |
|
|
privateslot |
19 {
20 ui->firstPointAbscissaLineEdit->clear();
21 ui->firstPointOrdinateLineEdit->clear();
22 ui->secondPointAbscissaLineEdit->clear();
23 ui->secondPointOrdinateLineEdit->clear();
24}
◆ on_createPushButton_clicked
void AddTrappyLineForm::on_createPushButton_clicked |
( |
| ) |
|
|
privateslot |
26 {
27 QString x1 =
ui->firstPointAbscissaLineEdit->displayText().replace(
',',
'.');
28 QString y1 =
ui->firstPointOrdinateLineEdit->displayText().replace(
',',
'.');
29 QString x2 =
ui->secondPointAbscissaLineEdit->displayText().replace(
',',
'.');
30 QString y2 =
ui->secondPointOrdinateLineEdit->displayText().replace(
',',
'.');
31 if (x1.isEmpty() || y1.isEmpty() || x2.isEmpty() || y2.isEmpty())
32 QMessageBox::warning(
33 this, "Warning!",
34 "There are empty fields! Please, enter values in all fields.");
35 else {
36 emit
AddTrappyLine(x1.toDouble(), y1.toDouble(), x2.toDouble(),
37 y2.toDouble());
38 close();
39 }
40}
◆ ui
Ui::AddTrappyLineForm* AddTrappyLineForm::ui |
|
private |
The documentation for this class was generated from the following files: