78 lines
1.5 KiB
C++
78 lines
1.5 KiB
C++
#include "vvodsectugol.h"
|
|
#include "ui_vvodsectugol.h"
|
|
|
|
vvodSectUgol::vvodSectUgol(QWidget *parent) :
|
|
QDialog(parent),
|
|
ui(new Ui::vvodSectUgol)
|
|
{
|
|
ui->setupUi(this);
|
|
setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
Widget* w =(Widget*) parent;
|
|
w->changeOpenWidget(this);
|
|
|
|
ui->lineEdit->setText(QString::number(w->sectUgLow1));
|
|
ui->lineEdit_2->setText(QString::number(w->sectUgLow2));
|
|
ui->lineEdit_3->setText(QString::number(w->sectUgHigh1));
|
|
ui->lineEdit_4->setText(QString::number(w->sectUgHigh2));
|
|
|
|
|
|
|
|
}
|
|
|
|
vvodSectUgol::~vvodSectUgol()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void vvodSectUgol::on_pushButton_3_clicked()
|
|
{
|
|
close();
|
|
}
|
|
|
|
void vvodSectUgol::on_pushButton_2_clicked()
|
|
{
|
|
Widget *w = (Widget*)parent();
|
|
w->sectUgLow1 = 0;
|
|
w->sectUgLow2 = 0;
|
|
w->sectUgHigh1 = 0;
|
|
w->sectUgHigh2 = 0;
|
|
|
|
w->kzsSect.height = 0;
|
|
w->kzsSect.bottom = 0;
|
|
close();
|
|
}
|
|
|
|
|
|
void vvodSectUgol::on_pushButton_clicked()
|
|
{
|
|
int sl1, sl2, sh1, sh2;
|
|
Widget *w = (Widget*)parent();
|
|
|
|
sl1 = ui->lineEdit->text().toInt();
|
|
sl2 = ui->lineEdit_2->text().toInt();
|
|
sh1 = ui->lineEdit_3->text().toInt();
|
|
sh2 = ui->lineEdit_4->text().toInt();
|
|
// ïðîâåðêè
|
|
|
|
///
|
|
w->sectUgLow1 = sl1;
|
|
w->sectUgLow2 = sl2;
|
|
w->sectUgHigh1 = sh1;
|
|
w->sectUgHigh2 = sh2;
|
|
|
|
|
|
w->kzsSect.height=(sh1*100+sh2)/100*6;
|
|
w->kzsSect.bottom=(sl1*100+sl2)/100*6;
|
|
|
|
w->writeFile();
|
|
|
|
close();
|
|
}
|
|
|
|
void vvodSectUgol::closeEvent(QCloseEvent *event)
|
|
{
|
|
((Widget*)parent())->clearOpenWidget();
|
|
event->accept();
|
|
}
|