bulletindicator.h
839 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
#ifndef BULLETINDICATOR_H
#define BULLETINDICATOR_H
#include <QWidget>
#include <QLabel>
class BulletIndicator : public QWidget
{
Q_OBJECT
public:
explicit BulletIndicator(QWidget *parent = 0);
void setBulletPixmap(const QPixmap &pixmap);
void setBulletPixmap(const QString &path);
void setCurrentBulletPixmap(const QPixmap &pixmap);
void setCurrentBulletPixmap(const QString &path);
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