-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathPartitionParametersDialog.cpp
More file actions
45 lines (34 loc) · 1.02 KB
/
PartitionParametersDialog.cpp
File metadata and controls
45 lines (34 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "PartitionParametersDialog.hpp"
#include "ui_PartitionParametersDialog.h"
PartitionParametersDialog::PartitionParametersDialog( PartitionNode* cvor, QWidget *parent) :
QDialog(parent),
ui(new Ui::PartitionParametersDialog),
prtCvor(cvor)
{
ui->setupUi(this);
}
PartitionParametersDialog::~PartitionParametersDialog()
{
delete ui;
}
void PartitionParametersDialog::on_pushButton_clicked()
{
QString unos = ui->Unos->text();
if(unos.isEmpty()){
QMessageBox::information(this,"Greska!", "Unesite zeljenu velicinu!");
return;
}
bool ok;
unos.toDouble(&ok);
if(ok == false){
QMessageBox::information(this,"Greska!", "Pogresan Unos! Unestie broj u intervalu [0.0, 1.0]");
return;
}
const double unos_d = unos.toDouble();
if(unos_d < 0.0 || unos_d > 1.0){
QMessageBox::information(this,"Greska!", "Pogresan Unos! Broj nije u intervalu [0.0, 1.0]");
return;
}
prtCvor->SetTestSizeRatio(unos_d);
this->close();
}