-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprogressbar.h
More file actions
37 lines (26 loc) · 780 Bytes
/
progressbar.h
File metadata and controls
37 lines (26 loc) · 780 Bytes
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
#ifndef PROGRESSBAR_H
#define PROGRESSBAR_H
#include <QtGui>
class ProgressBar
{
public:
ProgressBar(const QRect &pos);
void setMax(double max);
void setValue(double value);
void setAutoMaxAdjust(bool set) { myAutoMax = set; }
inline void addValue(double value) { setValue(myVal + value); }
inline double maxValue() const { return myMax; }
inline double value() const { return myVal; }
inline bool isFull() const { return myVal >= myMax; }
void setUpSpeed(int speed);
void setBrush(const QBrush &brush);
void paint(QPainter &p);
protected:
double myMax, myVal, myDelta;
bool myAutoMax;
QRect myRect;
int myUpSpeed, myUpCount, myUpValue;
QBrush myBrush;
QPixmap myBuffer;
};
#endif // PROGRESSBAR_H