-
Notifications
You must be signed in to change notification settings - Fork 4
/
chasewidget.h
48 lines (39 loc) · 976 Bytes
/
chasewidget.h
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
44
45
46
47
48
#ifndef CHASEWIDGET_H
#define CHASEWIDGET_H
#include <QWidget>
#include <QSize>
#include <QColor>
#include <QPixmap>
QT_BEGIN_NAMESPACE
class QHideEvent;
class QShowEvent;
class QPaintEvent;
class QTimerEvent;
QT_END_NAMESPACE
class ChaseWidget : public QWidget
{
Q_OBJECT
public:
ChaseWidget( QWidget *parent = 0, QPixmap pixmap = QPixmap(), bool pixmapEnabled = false );
void toggleOperation( int, bool );
void addOperation( int );
void removeOperation( int );
void setAnimated( bool value );
void setPixmapEnabled( bool enable );
QSize sizeHint( void ) const;
protected:
void paintEvent( QPaintEvent *event );
void timerEvent( QTimerEvent *event );
private:
int segmentCount( void ) const;
QColor colorForSegment( int segment ) const;
QVector<int> m_operations;
int m_segment;
int m_delay;
int m_step;
int m_timerId;
bool m_animated;
QPixmap m_pixmap;
bool m_pixmapEnabled;
};
#endif