-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathExportDialog.cpp
67 lines (53 loc) · 1.43 KB
/
ExportDialog.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
#include "ExportDialog.h"
ExportDialog::ExportDialog(QWidget * _parent) : QDialog(_parent)
{
QVBoxLayout * layout = new QVBoxLayout();
layout->addWidget(createExportGroup());
QDialogButtonBox * defaultButtonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(defaultButtonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(defaultButtonBox, SIGNAL(rejected()), this, SLOT(reject()));
layout->addWidget(defaultButtonBox);
setLayout(layout);
setWindowTitle(tr("Export:"));
resize(360, 180);
};
ExportDialog::~ExportDialog()
{
};
void ExportDialog::accept()
{
int r = 0;
if (whole->isChecked())
{
r = 1;
}
else if (onlyBelow->isChecked())
{
r = 2;
}
else if (onlyAbove->isChecked())
{
r = 3;
}
else if (onlyCut->isChecked()) {
r = 4;
}
done(r);
};
QGroupBox * ExportDialog::createExportGroup()
{
exportGroup = new QGroupBox(tr("Exporting Options"));
whole = new QRadioButton(tr("The Whole Surface"));
onlyBelow = new QRadioButton(tr("The Below Surface"));
onlyAbove = new QRadioButton(tr("The Above Surface"));
onlyCut = new QRadioButton(tr("The Cut Surface"));
whole->setChecked(true);
QVBoxLayout * vbox = new QVBoxLayout();
vbox->addWidget(whole);
vbox->addWidget(onlyBelow);
vbox->addWidget(onlyAbove);
vbox->addWidget(onlyCut);
vbox->addStretch(1);
exportGroup->setLayout(vbox);
return exportGroup;
};