-
Notifications
You must be signed in to change notification settings - Fork 0
/
modify_data.cpp
106 lines (100 loc) · 3.55 KB
/
modify_data.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#include "modify_data.h"
#include "ui_modify_data.h"
#include <QPixmap>
Modify_data::Modify_data(QWidget *parent, QVector<QCPScatterStyle::ScatterShape> s, Data *&d) :
QDialog(parent),
ui(new Ui::Modify_data), shapes{s}, data{d}
{
ui->setupUi(this);
#ifdef Q_OS_MAC
ui->label_4->setFont(QFont("Helvetica",16));
#endif
ui->size_curve->setValue(data->pen_curve.width());
ui->size_data->setValue(int(data->style.size()));
int m=data->style.shape();
if (m==5)
ui->shape_box->setCurrentText("ssDisc");
else if(m==6)
ui->shape_box->setCurrentText("ssSquare");
else if(m==7)
ui->shape_box->setCurrentText("ssDiamond");
else if(m==8)
ui->shape_box->setCurrentText("ssStar");
else if(m==2)
ui->shape_box->setCurrentText("ssCross");
else if(m==3)
ui->shape_box->setCurrentText("ssPlus");
else if(m==4)
ui->shape_box->setCurrentText("ssCircle");
else if(m==9)
ui->shape_box->setCurrentText("ssTriangle");
else if(m==10)
ui->shape_box->setCurrentText("ssTriangleInverted");
else if(m==11)
ui->shape_box->setCurrentText("ssCrossSquare");
else if(m==12)
ui->shape_box->setCurrentText("ssPlusSquare");
else if(m==13)
ui->shape_box->setCurrentText("ssCrossCircle");
else if(m==14)
ui->shape_box->setCurrentText("ssPlusCircle");
else if(m==15)
ui->shape_box->setCurrentText("ssPeace");
QColor temp=data->pen.color();
QString string=temp.name();
if (string=="#000000")
ui->color_box->setCurrentText("Black");
else if(string=="#ff0000")
ui->color_box->setCurrentText("Red");
else if(string=="#0000ff")
ui->color_box->setCurrentText("Blue");
else if(string=="#008000")
ui->color_box->setCurrentText("Green");
else if(string=="#00008b")
ui->color_box->setCurrentText("Darkblue");
else if(string=="#ff00ff")
ui->color_box->setCurrentText("Magenta");
else if(string=="#808080")
ui->color_box->setCurrentText("Grey");
else if(string=="#00ffff")
ui->color_box->setCurrentText("Cyan");
else if(string=="#8b008b")
ui->color_box->setCurrentText("Darkmagenta");
temp=data->pen_curve.color();
string=temp.name();
if (string=="#000000")
ui->color_curve_box->setCurrentText("Black");
else if(string=="#ff0000")
ui->color_curve_box->setCurrentText("Red");
else if(string=="#0000ff")
ui->color_curve_box->setCurrentText("Blue");
else if(string=="#008000")
ui->color_curve_box->setCurrentText("Green");
else if(string=="#00008b")
ui->color_curve_box->setCurrentText("Darkblue");
else if(string=="#ff00ff")
ui->color_curve_box->setCurrentText("Magenta");
else if(string=="#808080")
ui->color_curve_box->setCurrentText("Grey");
else if(string=="#00ffff")
ui->color_curve_box->setCurrentText("Cyan");
else if(string=="#8b008b")
ui->color_curve_box->setCurrentText("Darkmagenta");
}
Modify_data::~Modify_data()
{
delete ui;
}
void Modify_data::on_okButton_clicked()
{
data->style.setShape(shapes[ui->shape_box->currentIndex()]);
data->pen.setColor(ui->color_box->currentText());
data->pen_curve.setColor(ui->color_curve_box->currentText());
data->pen_curve.setWidth(ui->size_curve->value());
data->style.setSize(ui->size_data->value());
hide();
}
void Modify_data::on_cancelButton_clicked()
{
hide();
}