#pragma once #include #include #include 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; };