/
icon.cpp
61 lines (55 loc) · 1.01 KB
/
icon.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
#include "icon.h"
#include <stdlib.h>
/**
* @brief Icon::Icon
* Ikona o losowym kolorze i rozmiarze 10x10
*/
Icon::Icon()
{
this->color = QColor((float)qrand()/RAND_MAX*255, (float)qrand()/RAND_MAX*255, (float)qrand()/RAND_MAX*255);
this->geometry = Geometry(0, 0, 10, 10);
}
/**
* @brief Icon::Icon
* @param color kolor ikony
* @param geometry rozmiar ikony
*/
Icon::Icon(QColor color, Geometry geometry)
{
this->color = color;
this->geometry = geometry;
}
/**
* @brief Icon::setGeometry
*ustawia rozmiar
* @param geometry rozmiar ikony
*/
void Icon::setGeometry(Geometry geometry)
{
this->geometry = geometry;
}
/**
* @brief Icon::getGeometry
* @return referencję do geometrii
*/
Geometry &Icon::getGeometry()
{
return this->geometry;
}
/**
* @brief Icon::setColor
*ustawia kolor
* @param color kolor ikony
*/
void Icon::setColor(QColor color)
{
this->color = color;
}
/**
* @brief Icon::getColor
* @return kolor ikony
*/
QColor Icon::getColor()
{
return this->color;
}