feat:初始化wuhan_QT界面代码

This commit is contained in:
xu
2026-09-09 17:00:37 +08:00
commit 40473ad10b
537 changed files with 23934 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
#ifndef BASEPAGE_H
#define BASEPAGE_H
#include <QWidget>
#include <QEvent>
#include "appcontext.h"
class QLabel;
class QPushButton;
// ===================== 页面基类 =====================
// 所有页面继承此基类,持有应用上下文,统一提供页面跳转信号与控件构造助手
class BasePage : public QWidget
{
Q_OBJECT
public:
explicit BasePage(AppContext* ctx, QWidget* parent = nullptr);
AppContext* ctx() const { return m_ctx; }
// 控件构造助手
static QLabel* label(const QString& text, int px, const QString& color = C::TEXT,
bool bold = false, QWidget* parent = nullptr);
static QPushButton* button(const QString& text, const QString& variant = "",
QWidget* parent = nullptr);
signals:
void navigate(PageId id); // 请求切换到指定页面
protected:
AppContext* m_ctx = nullptr;
};
#endif // BASEPAGE_H