-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathshape.cpp
More file actions
70 lines (57 loc) · 934 Bytes
/
shape.cpp
File metadata and controls
70 lines (57 loc) · 934 Bytes
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 "shape.h"
#include <iostream>
Shape::Shape()
{
}
void Shape::test()
{
std::cout<<"test"<<std::endl;
}
void Shape::test2()
{
std::cout<<"test2"<<std::endl;
}
void Shape::addArrow(Arrow *arrow)
{
arrows.append(arrow);
}
void Shape::setDispText(QString text)
{
dispText = text;
update();
}
QString Shape::getDispText()
{
return dispText;
}
void Shape::editColor(Shape *x, QColor c)
{
std::cout<<"set color 2"<<std::endl;
x->color = c;
}
void Shape::setColor(int n)
{
std::cout<<"set color"<<std::endl;
if (n == 0)
{
color = QColor(Qt::blue);
}
else if (n == 1)
{
color = QColor(Qt::red);
}
else if(n == 2)
{
color = QColor(Qt::green);
}
else if (n == 3)
{
color = QColor(Qt::gray);
}
else if (n == 4)
{
color = QColor(Qt::yellow);
}
editColor(this, color);
update();
}