-
Notifications
You must be signed in to change notification settings - Fork 1
/
baseitem.h
67 lines (49 loc) · 1.37 KB
/
baseitem.h
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
#ifndef BASEITEM_H
#define BASEITEM_H
#include <QPainter>
#include <QString>
////////////////////////////////////////////////////////////////////////////////
class BaseItem
{
public:
BaseItem(qreal opacity, int steps);
virtual ~BaseItem() {}
virtual bool advance() = 0;
virtual void paint(QPainter &painter) = 0;
protected:
qreal myOpacity, op_step;
int myStep;
};
////////////////////////////////////////////////////////////////////////////////
class PixmapItem : public BaseItem
{
public:
PixmapItem(int x, int y, int dx, int dy, const QPixmap &pm, int steps);
virtual ~PixmapItem() {}
bool advance();
void paint(QPainter &painter);
protected:
int myX, myY;
int myDx, myDy;
QPixmap myPixmap;
};
////////////////////////////////////////////////////////////////////////////////
class TextItem : public BaseItem
{
public:
TextItem(QRect rect, const QString &text, int textFlags, const QFont &font, QColor color,
qreal opacity, int staysteps, int steps, int dx = 0, int dy = 0);
virtual ~TextItem() {}
virtual bool advance();
virtual void paint(QPainter &painter);
protected:
QRect myRect;
QString myText;
int myFlags;
QFont myFont;
QColor myColor;
int myStaySteps;
int myDx, myDy;
};
////////////////////////////////////////////////////////////////////////////////
#endif // BASEITEM_H