#ifndef INJURYANALYSISUI_H
#define INJURYANALYSISUI_H

#include "InjuryDatabase.h"
#include <QWidget>
#include <QtCharts>
#include <QChartView>
#include <QBarSeries>
#include <QBarSet>
#include <QBarCategoryAxis>
#include <QValueAxis>

QT_BEGIN_NAMESPACE
namespace Ui {
class InjuryAnalysisUI;    //声明ui命名空间下的类
}
QT_END_NAMESPACE

class InjuryAnalysisUI : public QWidget
{
    // Q_OBJECT宏用于提供Qt信号槽和元对象系统服务
    // 它必须限定为私有访问权限
    Q_OBJECT

public:
    InjuryAnalysisUI(QWidget *parent = nullptr);
    ~InjuryAnalysisUI();
    QList<Injury> result;

private:
    void createBarChart();
    void updateBarChart();

private slots:
    void on_searchButton_clicked();

private:
    // 创建Ui::InjuryAnalysisUI类型的指针，用于操作ui界面及其控件
    Ui::InjuryAnalysisUI *ui;
    QChart *chart;
    QChartView *chartView;
};

#endif // INJURYANALYSISUI_H
