-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathmybattery.h
More file actions
44 lines (33 loc) · 708 Bytes
/
mybattery.h
File metadata and controls
44 lines (33 loc) · 708 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
38
39
40
41
42
43
44
#ifndef MYBATTERY_H
#define MYBATTERY_H
#include <QWidget>
#include <QtGui>
class myBattery : public QWidget
{
Q_OBJECT
public:
explicit myBattery(QWidget *parent = 0);
protected:
void paintEvent(QPaintEvent *);
QSize sizeHint() const
{
return QSize(200,120);
}
private:
void drawFrame(QPainter* painter);
void drawBattery(QPainter* painter);
private:
QTimer* updateTimer;
bool m_bReverse;
qreal m_headWidth;
qreal m_value;
qreal m_currentValue;
QRectF m_batteryRect;
signals:
void valueChanged(qreal value);
private slots:
void UpdateGraph();
public slots:
void setValue(qreal value);
};
#endif // MYBATTERY_H