#ifndef TITLEBAR_H #define TITLEBAR_H #include #include class QLabel; class QPushButton; class AppContext; class LedIndicator; // ===================== 顶条组件(高 98px) ===================== // 左侧“通信状态:●正常/异常”,中央页面标题,右侧时间 + 软急停按钮 class TitleBar : public QWidget { Q_OBJECT public: explicit TitleBar(AppContext* ctx, QWidget* parent = nullptr); void setTitle(const QString& title); void setEstopVisible(bool visible); private slots: void updateEstop(); void updateTime(); private: AppContext* m_ctx; LedIndicator* m_comm; QLabel* m_title = nullptr; QLabel* m_time = nullptr; QPushButton* m_estop = nullptr; QTimer* m_clock = nullptr; }; #endif // TITLEBAR_H