Files
QT_wuhan_YT/widgets/titlebar.h
T
2026-10-14 09:59:42 +08:00

34 lines
763 B
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#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