Files
QT_wuhan_YT/widgets/titlebar.h
T
2026-09-09 17:00:37 +08:00

37 lines
803 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 <QTimer>
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