rock_widget_collection  0.1
ProgressIndicator.h
Go to the documentation of this file.
1 #ifndef PROGRESSINDICATOR_H
2 #define PROGRESSINDICATOR_H
3 
4 #include <QWidget>
5 #include <QColor>
6 
16 class ProgressIndicator : public QWidget
17 {
18  Q_OBJECT
19  Q_PROPERTY(int delay READ animationDelay WRITE setAnimationDelay)
21  Q_PROPERTY(QColor color READ color WRITE setColor)
22  Q_PROPERTY(QColor penColor READ penColor WRITE setPenColor)
23 public:
24  ProgressIndicator(QWidget* parent = 0);
25 
30  int animationDelay() const { return m_delay; }
31 
36  bool isAnimated () const;
37 
42  bool isDisplayedWhenStopped() const;
43 
47  const QColor & color() const { return m_color; }
48 
52  const QColor & penColor() const { return m_penColor; }
53 
54  virtual QSize sizeHint() const;
55  int heightForWidth(int w) const;
56 public slots:
60  void startAnimation();
61 
65  void stopAnimation();
66 
72  void setAnimationDelay(int delay);
73 
78  void setDisplayedWhenStopped(bool state);
79 
83  void setColor(const QColor & color);
84 
88  void setPenColor(const QColor & color);
89 protected:
90  virtual void timerEvent(QTimerEvent * event);
91  virtual void paintEvent(QPaintEvent * event);
92 private:
93  int m_angle;
94  int m_timerId;
95  int m_delay;
96  bool m_displayedWhenStopped;
97  QColor m_color;
98  QColor m_penColor;
99 };
100 
101 #endif // PROGRESSINDICATOR_H
int animationDelay() const
const QColor & color() const
virtual void paintEvent(QPaintEvent *event)
virtual QSize sizeHint() const
bool isDisplayedWhenStopped() const
void setAnimationDelay(int delay)
The ProgressIndicator class lets an application display a progress indicator to show that a lengthy t...
void setPenColor(const QColor &color)
int heightForWidth(int w) const
const QColor & penColor() const
void setDisplayedWhenStopped(bool state)
virtual void timerEvent(QTimerEvent *event)
void setColor(const QColor &color)
bool isAnimated() const