34 lines
763 B
C++
34 lines
763 B
C++
#ifndef TITLEBAR_H
|
||
#define TITLEBAR_H
|
||
|
||
#include <QWidget>
|
||
#include "uart.h"
|
||
|
||
class QLabel;
|
||
class AppContext;
|
||
class LedIndicator;
|
||
|
||
// ===================== 顶条组件(高 98px) =====================
|
||
// 左侧“车载端通信:●正常/异常”,中央页面标题,右侧“遥控器:●正常/断开 + 电量”
|
||
class TitleBar : public QWidget
|
||
{
|
||
Q_OBJECT
|
||
public:
|
||
explicit TitleBar(AppContext* ctx, QWidget* parent = nullptr);
|
||
|
||
void setTitle(const QString& title);
|
||
|
||
private slots:
|
||
void onRcLink(bool ok);
|
||
void onRcFrame(const RcFrame& f);
|
||
|
||
private:
|
||
AppContext* m_ctx;
|
||
LedIndicator* m_comm = nullptr;
|
||
LedIndicator* m_rc = nullptr;
|
||
QLabel* m_rcBat = nullptr;
|
||
QLabel* m_title = nullptr;
|
||
};
|
||
|
||
#endif // TITLEBAR_H
|