-
Notifications
You must be signed in to change notification settings - Fork 0
/
shapeannotation.cpp
73 lines (58 loc) · 1.57 KB
/
shapeannotation.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#include "shapeannotation.h"
#include "ui_shapeannotation.h"
ShapeAnnotation::ShapeAnnotation(QWidget *parent) :
QDialog(parent),
ui(new Ui::ShapeAnnotation)
{
ui->setupUi(this);
}
void ShapeAnnotation::setValues(QString ID, QString name, QString desc, shapeAnnotationType::Type typ)
{
this->ID = ID;
this->name = name;
this->typ = typ;
this->desc = desc;
ui->editRegionName->setText(name);
ui->editRegionDescription->setText(desc);
ui->editRegionID->setText(ID);
int index = (shapeAnnotationType::Type)typ;
ui->cboRegionType->clear();
for (int i = 0; i <= shapeAnnotationType::none; i++)
ui->cboRegionType->addItem(SHAPEANNOTATIONSTRINGS(i));
ui->cboRegionType->setCurrentIndex(index);
}
ShapeAnnotation::~ShapeAnnotation()
{
delete ui;
}
void ShapeAnnotation::on_editRegionName_textChanged(const QString &arg1)
{
name = arg1;
}
void ShapeAnnotation::on_editRegionID_textChanged(const QString &arg1)
{
ID = arg1;
}
void ShapeAnnotation::on_editRegionDescription_textChanged(const QString &arg1)
{
desc = arg1;
}
void ShapeAnnotation::on_cboRegionType_currentIndexChanged(int index)
{
typ = (shapeAnnotationType::Type)index;
}
void ShapeAnnotation::on_buttonBox_accepted()
{
ID = ui->editRegionID->text();
name = ui->editRegionName->text();
desc = ui->editRegionDescription->text();
int index = ui->cboRegionType->currentIndex();
typ = (shapeAnnotationType::Type)index;
}
void ShapeAnnotation::GetValues(QString& ID, QString& name, QString& desc, shapeAnnotationType::Type& typ)
{
ID = this->ID;
name = this->name;
desc = this->desc;
typ = this->typ;
}