xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 51KB
    文件類型: .rar
    金幣: 2
    下載: 0 次
    發布日期: 2021-06-16
  • 語言: 其他
  • 標簽: plot??

資源簡介

這里解決一個使用圖表的都會碰到的問題–跟隨鼠標顯示值,在QCustomPlot里非常簡單,它早就給出了解決方案-QCPItemTracer

資源截圖

代碼片段和文件信息


void?MEMSCurve::MEMSCurve()
{
//跟蹤器
m_xTracer?=?new?MyTracer(m_custPlot?MyTracer::XAxisTracer?m_custPlot);//x軸
m_tracer1?=?new?MyTracer(m_custPlot?MyTracer::DataTracer?m_custPlot);
m_tracer2?=?new?MyTracer(m_custPlot?MyTracer::DataTracer?m_custPlot);
m_lineTracer?=?new?MyTracer(m_custPlot?MyTracer::CrossLine?m_custPlot);//直線

connect(m_custPlot?SIGNAL(mouseMove(QMouseEvent*))?this?SLOT(myMouseMoveEvent(QMouseEvent*)));
}


void?MEMSCurve::myMouseMoveEvent(QMouseEvent*?event)
{
int?x_pos?=?event->pos().x();
int?y_pos?=?event->pos().y();

float?x_val?=?EMSTabPage.m_plot.m_custPlot->xAxis->pixelToCoord(x_pos);
float?y_val?=?EMSTabPage.m_plot.m_custPlot->yAxis->pixelToCoord(y_pos);
EMSTabPage.m_plot.m_xTracer->updatePosition(x_val?y_val);

auto?iter?=?EMSTabPage.m_plot.m_custPlot->graph(0)->data()->findBegin(x_val);
double?value1?=?iter->mainValue();
iter?=?EMSTabPage.m_plot.m_custPlot->graph(1)->data()->findBegin(x_val);
double?value2?=?iter->mainValue();

EMSTabPage.m_plot.m_tracer1->updatePosition(x_val?value1);
EMSTabPage.m_plot.m_tracer2->updatePosition(x_val?value2);

EMSTabPage.m_plot.m_lineTracer->updatePosition(x_val?y_val);

ui->custPlot->replot();//曲線重繪
}

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????1238??2018-04-16?16:26??MyTracer\main.cpp

?????文件???????4471??2018-04-16?16:22??MyTracer\MyTracer.cpp

?????文件????????977??2018-04-16?15:56??MyTracer\MyTracer.h

?????文件????????137??2018-04-16?16:30??MyTracer\說明.txt

?????文件??????77676??2018-04-16?16:27??MyTracer\運行結果.PNG

?????目錄??????????0??2018-04-16?16:28??MyTracer

-----------?---------??----------?-----??----

????????????????84499????????????????????6


評論

共有 條評論