亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cpuplot.cpp

?? qt4.3.2 ,red hat9中d動態調用cpu的程序
?? CPP
字號:
#include <qapplication.h>#include <qlayout.h>#include <qlabel.h>#include <qpainter.h>#include <qwt_plot_layout.h>#include <qwt_plot_curve.h>#include <qwt_scale_draw.h>#include <qwt_scale_widget.h>#include <qwt_legend.h>#include <qwt_legend_item.h>#include "cpupiemarker.h"#include "cpuplot.h"class TimeScaleDraw: public QwtScaleDraw{public:    TimeScaleDraw(const QTime &base):        baseTime(base)    {    }    virtual QwtText label(double v) const    {        QTime upTime = baseTime.addSecs((int)v);        return upTime.toString();    }private:    QTime baseTime;};class Background: public QwtPlotItem{public:    Background()    {        setZ(0.0);    }    virtual int rtti() const    {        return QwtPlotItem::Rtti_PlotUserItem;    }    virtual void draw(QPainter *painter,        const QwtScaleMap &, const QwtScaleMap &yMap,        const QRect &rect) const    {        QColor c(Qt::white);        QRect r = rect;        for ( int i = 100; i > 0; i -= 10 )        {            r.setBottom(yMap.transform(i - 10));            r.setTop(yMap.transform(i));            painter->fillRect(r, c);            c = c.dark(110);        }    }};class CpuCurve: public QwtPlotCurve{public:    CpuCurve(const QString &title):        QwtPlotCurve(title)    {#if QT_VERSION >= 0x040000        setRenderHint(QwtPlotItem::RenderAntialiased);#endif    }    void setColor(const QColor &color)    {#if QT_VERSION >= 0x040000        QColor c = color;        c.setAlpha(150);        setPen(c);        setBrush(c);#else        setPen(color);        setBrush(QBrush(color, Qt::Dense4Pattern));#endif    }};CpuPlot::CpuPlot(QWidget *parent):    QwtPlot(parent),    dataCount(0){    setAutoReplot(false);    plotLayout()->setAlignCanvasToScales(true);    QwtLegend *legend = new QwtLegend;    legend->setItemMode(QwtLegend::CheckableItem);    insertLegend(legend, QwtPlot::RightLegend);    setAxisTitle(QwtPlot::xBottom, " System Uptime [h:m:s]");    setAxisScaleDraw(QwtPlot::xBottom,         new TimeScaleDraw(cpuStat.upTime()));    setAxisScale(QwtPlot::xBottom, 0, HISTORY);    setAxisLabelRotation(QwtPlot::xBottom, -50.0);    setAxisLabelAlignment(QwtPlot::xBottom, Qt::AlignLeft | Qt::AlignBottom);    /*     In situations, when there is a label at the most right position of the     scale, additional space is needed to display the overlapping part     of the label would be taken by reducing the width of scale and canvas.     To avoid this "jumping canvas" effect, we add a permanent margin.     We don't need to do the same for the left border, because there     is enough space for the overlapping label below the left scale.     */    QwtScaleWidget *scaleWidget = axisWidget(QwtPlot::xBottom);    const int fmh = QFontMetrics(scaleWidget->font()).height();    scaleWidget->setMinBorderDist(0, fmh / 2);    setAxisTitle(QwtPlot::yLeft, "Cpu Usage [%]");    setAxisScale(QwtPlot::yLeft, 0, 100);    Background *bg = new Background();    bg->attach(this);    CpuPieMarker *pie = new CpuPieMarker();    pie->attach(this);        CpuCurve *curve;    curve = new CpuCurve("System");    curve->setColor(Qt::red);    curve->attach(this);    data[System].curve = curve;    curve = new CpuCurve("User");    curve->setColor(Qt::blue);    curve->setZ(curve->z() - 1);    curve->attach(this);    data[User].curve = curve;    curve = new CpuCurve("Total");    curve->setColor(Qt::black);    curve->setZ(curve->z() - 2);    curve->attach(this);    data[Total].curve = curve;    curve = new CpuCurve("Idle");    curve->setColor(Qt::darkCyan);    curve->setZ(curve->z() - 3);    curve->attach(this);    data[Idle].curve = curve;    showCurve(data[System].curve, true);    showCurve(data[User].curve, true);    showCurve(data[Total].curve, false);    showCurve(data[Idle].curve, false);    for ( int i = 0; i < HISTORY; i++ )        timeData[HISTORY - 1 - i] = i;    (void)startTimer(1000); // 1 second    connect(this, SIGNAL(legendChecked(QwtPlotItem *, bool)),        SLOT(showCurve(QwtPlotItem *, bool)));}void CpuPlot::timerEvent(QTimerEvent *){    for ( int i = dataCount; i > 0; i-- )    {        for ( int c = 0; c < NCpuData; c++ )        {            if ( i < HISTORY )                data[c].data[i] = data[c].data[i-1];        }    }    cpuStat.statistic(data[User].data[0], data[System].data[0]);    data[Total].data[0] = data[User].data[0] +         data[System].data[0];    data[Idle].data[0] = 100.0 - data[Total].data[0];    if ( dataCount < HISTORY )        dataCount++;    for ( int j = 0; j < HISTORY; j++ )        timeData[j]++;    setAxisScale(QwtPlot::xBottom,         timeData[HISTORY - 1], timeData[0]);    for ( int c = 0; c < NCpuData; c++ )    {        data[c].curve->setRawData(            timeData, data[c].data, dataCount);    }    replot();}void CpuPlot::showCurve(QwtPlotItem *item, bool on){    item->setVisible(on);    QWidget *w = legend()->find(item);    if ( w && w->inherits("QwtLegendItem") )        ((QwtLegendItem *)w)->setChecked(on);        replot();}int main(int argc, char **argv){    QApplication a(argc, argv);         QWidget vBox;#if QT_VERSION >= 0x040000    vBox.setWindowTitle("Cpu Plot");#else    vBox.setCaption("Cpu Plot");#endif    CpuPlot *plot = new CpuPlot(&vBox);    plot->setTitle("History");    plot->setMargin(5);    QString info("Press the legend to en/disable a curve");    QLabel *label = new QLabel(info, &vBox);    QVBoxLayout *layout = new QVBoxLayout(&vBox);    layout->addWidget(plot);    layout->addWidget(label);#if QT_VERSION < 0x040000    a.setMainWidget(&vBox);#endif    vBox.resize(600,400);    vBox.show();    return a.exec();  }   

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人a免费在线看| 亚洲国产欧美日韩另类综合| 91麻豆精品91久久久久同性| av网站一区二区三区| 成人综合在线观看| 成人亚洲一区二区一| 国产·精品毛片| av在线播放一区二区三区| 成人精品电影在线观看| 不卡影院免费观看| 成人午夜激情影院| 色综合久久综合| 欧美日韩一区二区在线观看 | 亚洲国产人成综合网站| 一区二区三区丝袜| 午夜精品久久久久久久久| 日韩中文字幕av电影| 日本欧美肥老太交大片| 久久精品国产一区二区三区免费看| 青青草国产成人99久久| 美女脱光内衣内裤视频久久网站| 久久精工是国产品牌吗| 国产精品18久久久| 成人免费视频一区| 欧美三片在线视频观看| 日韩午夜激情电影| 中文字幕av免费专区久久| 国产精品久久久久久久久动漫| 亚洲欧美日韩中文字幕一区二区三区| 亚洲精品欧美在线| 精品一区二区三区久久久| 成人av在线网站| 欧美日韩另类一区| 久久久久成人黄色影片| 一区二区三区精品视频在线| 精品一区二区三区av| 成人h动漫精品| 欧美成人欧美edvon| 亚洲欧美在线观看| 久久精品国产亚洲高清剧情介绍| 成人丝袜视频网| 日韩欧美色电影| 亚洲精品视频在线看| 国产一区二三区好的| 欧美在线高清视频| 久久久久国产成人精品亚洲午夜| 亚洲电影一区二区| av亚洲精华国产精华| 日韩一区二区三区av| 亚洲激情自拍偷拍| 国产成人8x视频一区二区 | 久久精工是国产品牌吗| 一本一道波多野结衣一区二区| 精品蜜桃在线看| 五月天激情综合网| 色欲综合视频天天天| 国产亚洲欧美一级| 久草这里只有精品视频| 欧美精品1区2区3区| 最新国产の精品合集bt伙计| 国产成人在线网站| 欧美成人精品3d动漫h| 午夜精品久久久久久久99水蜜桃| 91一区二区在线观看| 中文字幕av免费专区久久| 国产老妇另类xxxxx| 日韩欧美国产综合| 美女看a上一区| 欧美精品1区2区| 日韩在线播放一区二区| 欧美三级韩国三级日本三斤| 亚洲男人电影天堂| 99精品视频一区| 亚洲少妇最新在线视频| 91网站最新地址| 亚洲综合色婷婷| 欧美色成人综合| 日韩成人一级片| 日韩美女天天操| 国内久久婷婷综合| 久久亚洲二区三区| 国产美女久久久久| 中文一区在线播放| 白白色亚洲国产精品| 综合欧美亚洲日本| 日本韩国一区二区三区视频| 亚洲精品成人精品456| 在线中文字幕不卡| 日本女优在线视频一区二区| 日韩情涩欧美日韩视频| 久久国产精品72免费观看| 久久久亚洲精品一区二区三区| 国产做a爰片久久毛片| 中文字幕乱码久久午夜不卡| 91麻豆国产香蕉久久精品| 亚洲午夜羞羞片| 日韩欧美aaaaaa| 成人h动漫精品一区二区| 一区二区三区在线免费视频| 欧美精品在线一区二区三区| 国产一区二区三区精品欧美日韩一区二区三区 | 成人福利视频在线看| 日韩美女啊v在线免费观看| 欧美怡红院视频| 久久国内精品视频| 中文一区二区在线观看| 精品视频在线看| 成人午夜电影小说| 亚洲成av人片在线| 亚洲国产精品传媒在线观看| 在线免费一区三区| 国产一区二区三区不卡在线观看 | 日韩丝袜美女视频| 成人一区二区三区视频 | 日韩视频一区二区三区在线播放| 国产精品一线二线三线| 一区二区三区在线看| 欧美电影免费观看完整版| 91在线精品一区二区| 久久精品国产一区二区三区免费看| 亚洲欧美一区二区视频| 精品免费国产二区三区| 欧美无砖砖区免费| 成人免费av网站| 日本va欧美va瓶| 一区二区三区欧美| 久久网站热最新地址| 欧美日韩精品一区二区三区 | 亚洲成av人片| 亚洲欧洲精品成人久久奇米网 | 国产一区二区电影| 亚洲成人av一区| 国产精品高潮久久久久无| 日韩欧美一区二区久久婷婷| 欧美亚洲禁片免费| 波多野结衣精品在线| 国产麻豆精品theporn| 男男gaygay亚洲| 亚洲国产精品久久久久婷婷884| 欧美激情一区二区三区不卡| 精品国产3级a| 91精品国产色综合久久久蜜香臀| 色吧成人激情小说| bt欧美亚洲午夜电影天堂| 风间由美一区二区av101| 韩国精品一区二区| 精品一区二区免费在线观看| 亚洲成在线观看| 亚洲午夜av在线| 亚洲一区二区视频在线观看| 亚洲精品福利视频网站| 亚洲乱码国产乱码精品精小说| 国产精品成人网| 中文字幕在线一区免费| 国产精品久99| 亚洲欧美一区二区三区极速播放| 国产午夜一区二区三区| 欧美激情综合在线| 国产精品久久久一本精品| 日本一区二区三区在线观看| 久久久三级国产网站| 久久久精品tv| 亚洲人亚洲人成电影网站色| 亚洲乱码国产乱码精品精的特点 | 欧美午夜一区二区三区| 欧美专区日韩专区| 欧美在线观看视频在线| 日韩一区二区三区电影在线观看| 日韩一级免费一区| 久久久精品免费网站| 中文字幕精品三区| 亚洲综合小说图片| 免费成人小视频| 国产91精品一区二区麻豆网站| 成人免费高清在线| 欧美在线视频全部完| 91精品国产综合久久久久久漫画| 精品久久国产97色综合| 中文字幕av一区二区三区| 亚洲小说欧美激情另类| 麻豆精品一区二区| 成人综合婷婷国产精品久久 | 欧美xxx久久| 中文字幕在线免费不卡| 亚洲一二三四区| 捆绑变态av一区二区三区| 成人午夜短视频| 在线成人av网站| 中文字幕精品综合| 日韩av电影免费观看高清完整版 | 精品99一区二区| 亚洲人成网站在线| 奇米精品一区二区三区四区| 成人激情小说网站| 欧美精品在线观看播放| 国产精品美女久久久久aⅴ国产馆| 亚洲在线一区二区三区| 国产综合色在线视频区| 欧美日韩在线三级| 国产精品初高中害羞小美女文|