bulletindicator.h
726 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
#ifndef BULLETINDICATOR_H
#define BULLETINDICATOR_H
#include <QWidget>
#include <QLabel>
class BulletIndicator : public QWidget
{
Q_OBJECT
public:
explicit BulletIndicator(QWidget *parent = 0);
void setBulletPixmap(QPixmap &pixmap);
void setCurrentBulletPixmap(QPixmap &pixmap);
int maximum() { return max; }
int currentIndex() { return cur; }
signals:
public slots:
void setCurrentIndex(int index);
void setMaximum(int maximum);
protected:
void resizeEvent(QResizeEvent *event);
private:
int max;
int cur;
int padding;
QPixmap bulletPixmap;
QPixmap currentBulletPixmap;
QList<QLabel *> bullets;
void updatePosition();
};
#endif // BULLETINDICATOR_H