initial commit
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
#include <QString>
|
||||
|
||||
class SystemInfo : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(int batteryPercent
|
||||
READ batteryPercent
|
||||
NOTIFY batteryPercentChanged)
|
||||
|
||||
public:
|
||||
explicit SystemInfo(QObject *parent = nullptr);
|
||||
|
||||
int batteryPercent() const;
|
||||
|
||||
signals:
|
||||
void batteryPercentChanged();
|
||||
|
||||
private slots:
|
||||
void updateBattery();
|
||||
|
||||
private:
|
||||
QString findBatteryCapacityPath() const;
|
||||
|
||||
int m_batteryPercent = -1;
|
||||
QString m_capacityPath;
|
||||
QTimer m_batteryTimer;
|
||||
};
|
||||
Reference in New Issue
Block a user