#ifndef BULLETINDICATOR_H #define BULLETINDICATOR_H #include #include 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 bullets; void updatePosition(); }; #endif // BULLETINDICATOR_H