forked from CodElecCz/CameraUIv1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStorageView.h
57 lines (47 loc) · 1.15 KB
/
StorageView.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
51
52
53
54
55
56
57
#ifndef STORAGEVIEW_H
#define STORAGEVIEW_H
#include <QWidget>
#include <QTimer>
#include <QtCharts/QChartView>
#include <QtCharts/QPieSeries>
#include <QMap>
#include <QLabel>
QT_CHARTS_USE_NAMESPACE
namespace Ui {
class StorageView;
}
enum ESTORAGE_Info
{
ESTORAGE_Info_Name = 0,
ESTORAGE_Info_System,
ESTORAGE_Info_Total,
ESTORAGE_Info_Free,
ESTORAGE_Info_Mem_Total,
ESTORAGE_Info_Mem_Free,
//...
ESTORAGE_Info_Size
};
class StorageView : public QWidget
{
Q_OBJECT
public:
explicit StorageView(QString path = "c:/", int storageMinLimit = 10, int storageMinData = 5, QWidget *parent = nullptr);
~StorageView();
private:
void updateGraphData();
void memoryUsage();
QString getOldestPath(QString path);
private slots:
//on_{ObjectName}_{SignalName}
void timer_timeout();
private:
Ui::StorageView *ui;
QTimer *timer;
QChartView *chartView;
QPieSeries *series;
QString path;
int limit;
int limitData;
QMap<ESTORAGE_Info, QLabel*> infoLabels;
};
#endif // STORAGEVIEW_H