first commit
This commit is contained in:
41
widgets/statusbar.h
Normal file
41
widgets/statusbar.h
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef STATUSBAR_H
|
||||
#define STATUSBAR_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <QLabel>
|
||||
#include <QTimer>
|
||||
|
||||
class StatusBar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit StatusBar(QWidget *parent = nullptr);
|
||||
~StatusBar();
|
||||
|
||||
void setTitle(const QString &title);
|
||||
void setBatteryLevel(int level);
|
||||
void setNetworkStatus(bool connected, const QString &type = "WiFi");
|
||||
|
||||
private slots:
|
||||
void updateTime();
|
||||
void updateBatteryLevel();
|
||||
void updateNetworkStatus();
|
||||
|
||||
private:
|
||||
void setupUI();
|
||||
int getBatteryPercentage();
|
||||
bool isWiFiConnected();
|
||||
|
||||
QLabel *m_titleLabel;
|
||||
QLabel *m_timeLabel;
|
||||
QLabel *m_batteryLabel;
|
||||
QLabel *m_networkLabel;
|
||||
QTimer *m_timer;
|
||||
|
||||
int m_batteryLevel;
|
||||
bool m_networkConnected;
|
||||
QString m_networkType;
|
||||
};
|
||||
|
||||
#endif // STATUSBAR_H
|
||||
Reference in New Issue
Block a user