cpuplot.h

来自「QWT5.01用于Qt开发的二维图形库程序」· C头文件 代码 · 共 43 行

H
43
字号
#include <qwt_plot.h>
#include "cpustat.h"

#define HISTORY 60 // seconds

class QwtPlotCurve;

class CpuPlot : public QwtPlot 
{
    Q_OBJECT
public:
    enum CpuData
    {
        User,
        System,
        Total,
        Idle,

        NCpuData
    };

    CpuPlot(QWidget * = 0);
    const QwtPlotCurve *cpuCurve(int id) const
        { return data[id].curve; }

protected:
    void timerEvent(QTimerEvent *e);

private slots:
    void showCurve(QwtPlotItem *, bool on);

private:
    struct
    {
        QwtPlotCurve *curve;
        double data[HISTORY];
    } data[NCpuData];
    double timeData[HISTORY];

    int dataCount;
    CpuStat cpuStat;
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?