-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmainoptions.cpp
46 lines (41 loc) · 1.14 KB
/
mainoptions.cpp
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 "mainoptions.h"
MainOptions::MainOptions(QWidget *parent)
: QWidget(parent) {
mainLayout = new QVBoxLayout(this);
setParent(parent);
createMainLayout();
setLayout(mainLayout);
}
void MainOptions::createMainLayout(){
QLabel *lable = new QLabel(tr("Размерность координат станка, размеров и отступов для фрез"));
buttonMM = new QRadioButton("Миллиметры", this);
buttonSM = new QRadioButton("Сантиметры", this);
buttonM = new QRadioButton("Метры", this);
mainLayout->addWidget(lable);
mainLayout->addWidget(buttonMM);
mainLayout->addWidget(buttonSM);
mainLayout->addWidget(buttonM);
}
double MainOptions::getDimension(){
if (buttonMM->isChecked()){
return 1e-3;
}
if (buttonSM->isChecked()){
return 1e-2;
}
if (buttonM->isChecked()){
return 1;
}
return 0.0;
}
void MainOptions::setDimension(double d){
if (d==1e-3){
buttonMM->setChecked(true);
}
if (d==1e-2){
buttonSM->setChecked(true);
}
if (d==1){
buttonM->setChecked(true);
}
}