XNSim/XNSysMonitor/mainwindow.h

36 lines
720 B
C
Raw Normal View History

2025-04-28 12:25:20 +08:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QLabel>
#include <QVector>
#include <QComboBox>
#include "qcustomplot.h"
QT_BEGIN_NAMESPACE
namespace Ui
{
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private slots:
void handleDataReady(int coreIndex, double usage);
private:
void updateCpuUsage();
void updateCpuUsageForPlot(QCustomPlot *plot, int coreIndex, double usage);
Ui::MainWindow *ui;
QVector<QComboBox *> cpuComboBoxes; // 用于存储每个图表的下拉框
QVector<QCustomPlot *> cpuPlots; // 用于存储每个核心的图表
};
#endif // MAINWINDOW_H