QtPass  1.2.0-pre
Multi-platform GUI for pass, the standard unix password manager.
qprogressindicator.h
Go to the documentation of this file.
1 #ifndef QPROGRESSINDICATOR_H_
2 #define QPROGRESSINDICATOR_H_
3 
4 #include <QColor>
5 #include <QWidget>
6 
16 class QProgressIndicator : public QWidget {
17  Q_OBJECT
21  Q_PROPERTY(int delay READ animationDelay WRITE setAnimationDelay)
25  Q_PROPERTY(bool displayedWhenStopped READ isDisplayedWhenStopped WRITE
30  Q_PROPERTY(QColor color READ color WRITE setColor)
31 
32 public:
33  explicit QProgressIndicator(QWidget *parent = 0);
34 
40  int animationDelay() const { return m_delay; }
41 
47  bool isAnimated() const;
48 
55  bool isDisplayedWhenStopped() const;
56 
60  const QColor &color() const { return m_color; }
61 
62  virtual QSize sizeHint() const;
63  int heightForWidth(int w) const;
64 
65 public slots:
69  void startAnimation();
70 
74  void stopAnimation();
75 
82  void setAnimationDelay(int delay);
83 
89  void setDisplayedWhenStopped(bool state);
90 
94  void setColor(const QColor &color);
95 
96 protected:
97  virtual void timerEvent(QTimerEvent *event);
98  virtual void paintEvent(QPaintEvent *event);
99 
100 private:
101  int m_angle;
102  int m_timerId;
103  int m_delay;
104  bool m_displayedWhenStopped;
105  QColor m_color;
106 };
107 
108 #endif // QPROGRESSINDICATOR_H_
int delay
QProgressIndicator::delay in miliseconds.
void startAnimation()
Starts the spin animation.
bool isDisplayedWhenStopped() const
Returns a Boolean value indicating whether the receiver shows itself even when it is not animating...
int heightForWidth(int w) const
QProgressIndicator::heightForWidth square ratio.
The QProgressIndicator class lets an application display a progress indicator to show that a lengthy ...
virtual QSize sizeHint() const
QProgressIndicator::sizeHint default minimum size.
bool displayedWhenStopped
QProgressIndicator::displayedWhenStopped render when not spinning.
void setDisplayedWhenStopped(bool state)
Sets whether the component hides itself when it is not animating.
virtual void paintEvent(QPaintEvent *event)
QProgressIndicator::paintEvent draw the spinner.
void stopAnimation()
Stops the spin animation.
virtual void timerEvent(QTimerEvent *event)
QProgressIndicator::timerEvent do the actual animation.
bool isAnimated() const
Returns a Boolean value indicating whether the component is currently animated.
int animationDelay() const
Returns the delay between animation steps.
const QColor & color() const
Returns the color of the component.
void setColor(const QColor &color)
Sets the color of the components to the given color.
void setAnimationDelay(int delay)
Sets the delay between animation steps.