Locus No Pilotus
Project of four first grade MIPT DAFE/RSE students (for engineering practical work in the second semester) in Qt C++
Loading...
Searching...
No Matches
AddTrappyLineForm Class Reference

#include <add_trappy_line_form.h>

Inheritance diagram for AddTrappyLineForm:
Collaboration diagram for AddTrappyLineForm:

Signals

void AddTrappyLine (double x1, double y1, double x2, double y2)
 

Public Member Functions

 AddTrappyLineForm (QWidget *parent=nullptr)
 
 ~AddTrappyLineForm ()
 

Private Slots

void on_clearPushButton_clicked ()
 
void on_createPushButton_clicked ()
 

Private Attributes

Ui::AddTrappyLineForm * ui
 

Constructor & Destructor Documentation

◆ AddTrappyLineForm()

AddTrappyLineForm::AddTrappyLineForm ( QWidget * parent = nullptr)
explicit
8 : QDialog(parent), ui(new Ui::AddTrappyLineForm) {
9 ui->setupUi(this);
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}
Ui::AddTrappyLineForm * ui
Definition add_trappy_line_form.h:27

◆ ~AddTrappyLineForm()

AddTrappyLineForm::~AddTrappyLineForm ( )
17{ delete ui; }

Member Function Documentation

◆ AddTrappyLine

void AddTrappyLineForm::AddTrappyLine ( double x1,
double y1,
double x2,
double y2 )
signal
Here is the caller graph for this function:

◆ 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}
void AddTrappyLine(double x1, double y1, double x2, double y2)
Here is the call graph for this function:

Member Data Documentation

◆ ui

Ui::AddTrappyLineForm* AddTrappyLineForm::ui
private

The documentation for this class was generated from the following files: