forked from aamirglb/GCSWidgets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
battery.h
50 lines (42 loc) · 1012 Bytes
/
battery.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
49
50
/*
* Copyright (c) 2019, ADASI
* All rights reserved.
* This file contains proprietary information.
* This file shall not be duplicated, used, modified,
* or disclosed in whole or in part without
* the express written consent of ADASI.
*
* Author Name: Mohammad Aamir Ali
* $Id: $
* $HeadURL: $
* $LastChangedRevision: $
* $LastChangedDate: $
* $LastChangedBy: $
*/
#ifndef BATTERY_H
#define BATTERY_H
#include <QWidget>
class QTimer;
class Battery : public QWidget
{
Q_OBJECT
public:
explicit Battery(QWidget *parent = nullptr);
QSize sizeHint() const;
QSize minimumSizeHint() const;
signals:
public slots:
void setValue(int newValue);
void blink();
void setBoarderColor(QString color);
protected:
void paintEvent(QPaintEvent *);
private:
int32_t m_width {100};
int32_t m_height {40};
int32_t m_value {-1};
bool m_visible{true};
QString m_boarderColor {"white"};
QTimer *m_timer {nullptr};
};
#endif // BATTERY_H