| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- #ifndef STATSWIDGET_H
- #define STATSWIDGET_H
- #include <QWidget>
- #include <QLabel>
- #include <QVBoxLayout>
- #include <QHBoxLayout>
- #include <QGroupBox>
- #include <QJsonObject>
- #include <QJsonArray>
- #include <QDateTime>
- 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
|