#ifndef STATSWIDGET_H #define STATSWIDGET_H #include #include #include #include #include #include #include #include class StatsWidget : public QWidget { Q_OBJECT public: explicit StatsWidget(QWidget *parent = nullptr); ~StatsWidget(); // 更新统计信息 void updateStats(const QJsonObject& statsData); private: void setupUI(); void applyStyles(); // UI组件 QGroupBox *m_statsGroup; QLabel *m_totalCountLabel; QLabel *m_type0CountLabel; QLabel *m_type1CountLabel; QLabel *m_type2CountLabel; QLabel *m_lastUpdateLabel; // 数据 int m_totalCount; int m_type0Count; int m_type1Count; int m_type2Count; QDateTime m_lastUpdate; }; #endif // STATSWIDGET_H