00001 #ifndef __QBUSYBAR_H__ 00002 #define __QBUSYBAR_H__ 00003 00004 #include <qwidget.h> 00005 00006 class QColor; 00007 class QTimer; 00008 00009 class QBusyBar : public QWidget { 00010 Q_OBJECT 00011 00012 public: 00013 QBusyBar ( QWidget *parent = 0, const char *name = 0, int flags = 0 ); 00014 virtual ~QBusyBar ( ); 00015 00016 bool isBusy ( ) const; 00017 00018 void setParameters ( int div, int fade, int speed ); 00019 00020 public slots: 00021 void beginBusy ( ); 00022 void endBusy ( ); 00023 00024 void setBusy ( bool b ); 00025 00026 protected: 00027 virtual void paintEvent ( QPaintEvent *e ); 00028 00029 private slots: 00030 void slotTimeout ( ); 00031 00032 private: 00033 QTimer *m_timer; 00034 int m_busy; 00035 00036 int m_div; 00037 int m_pos; // 0 .. 2 * m_div - 1 00038 int m_fade; // 0 .. m_div - 1 00039 int m_speed; 00040 QColor *m_fadecols; 00041 }; 00042 00043 #endif
1.4.2