mirror of
https://github.com/iDescriptor/iDescriptor.git
synced 2026-06-21 19:35:49 +08:00
refactor DeviceInfoWidget
- Adds battery widget and real-time battery monitoring - Creates custom battery widget component for visual battery status display - Integrates comprehensive battery information including charging state, current level, connection type (USB/USB-C), and power consumption - Implements automatic battery status updates every 30 seconds to keep information current during device connection - Refactors battery data retrieval into separate service function for better code organization and reusability - Enhances device info header with charging status, power consumption, and connection type indicators alongside visual battery widget
This commit is contained in:
+10
-1
@@ -1,6 +1,9 @@
|
||||
#ifndef DEVICEINFOWIDGET_H
|
||||
#define DEVICEINFOWIDGET_H
|
||||
#include "batterywidget.h"
|
||||
#include "iDescriptor.h"
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
#include <QWidget>
|
||||
|
||||
class DeviceInfoWidget : public QWidget
|
||||
@@ -15,7 +18,13 @@ private slots:
|
||||
|
||||
private:
|
||||
QPixmap getDeviceIcon(const std::string &productType);
|
||||
iDescriptorDevice *device;
|
||||
iDescriptorDevice *m_device;
|
||||
QTimer *m_updateTimer;
|
||||
void updateBatteryInfo();
|
||||
QLabel *m_chargingStatusLabel;
|
||||
QLabel *m_chargingWattsLabel;
|
||||
QLabel *m_cableTypeLabel;
|
||||
BatteryWidget *m_batteryWidget;
|
||||
};
|
||||
|
||||
#endif // DEVICEINFOWIDGET_H
|
||||
|
||||
Reference in New Issue
Block a user