-
Notifications
You must be signed in to change notification settings - Fork 0
/
moneydisplayer.h
42 lines (30 loc) · 892 Bytes
/
moneydisplayer.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
#ifndef MONEYDISPLAY_H
#define MONEYDISPLAY_H
#include "abstractgameitem.h"
class MoneyDisplayer : public AbstractGameItem
{
Q_OBJECT
public:
MoneyDisplayer(QGraphicsScene *scene,
QGraphicsItem *parent = 0);
~MoneyDisplayer(){}
// return the collide rect
QRectF boundingRect() const;
// return the paint path of the pixmap
QPainterPath shape() const;
void paint(QPainter *painter,
const QStyleOptionGraphicsItem *option,
QWidget *widget = Q_NULLPTR);
void setIndex(const int index);
void setDigital(const int digital);
const int digital() const;
const QString & name() const;
public slots:
void slt_moneyChanged(int);
protected:
const QString m_name;
// the digital of the number corresponding to money
int m_digital;
QPixmaps m_pixs;
};
#endif // MONEYDISPLAY_H