void CQPlotSubwidget::addHisto1DTab(const std::string &title, const CPlotDataChannelSpec &x, const C_FLOAT64 &incr) { CPlotItem *item = new CPlotItem(title, NULL, CPlotItem::histoItem1d); item->addChannel(x); item->setValue("increment", incr); addPlotItem(item); }
void CQPlotSubwidget::addCurveTab(const std::string &title, const CPlotDataChannelSpec &x, const CPlotDataChannelSpec &y) { CPlotItem *item = new CPlotItem(title, NULL, CPlotItem::curve2d); item->addChannel(x); item->addChannel(y); addPlotItem(item); }
void CQPlotSubwidget::addSpectrumTab(const std::string &title, const CPlotDataChannelSpec &x, const CPlotDataChannelSpec &yone, const CPlotDataChannelSpec &ytwo) { CPlotItem *item = new CPlotItem(title, NULL, CPlotItem::spectogram); item->addChannel(x); item->addChannel(yone); item->addChannel(ytwo); addPlotItem(item); }
bool PlotWidget::eventFilter(QObject *obj, QEvent *ev) { if (ev->type() == QEvent::Scroll) { QScrollEvent *se = static_cast<QScrollEvent *>(ev); QScroller *scroller = QScroller::scroller(m_widget); QPointF v = scroller->velocity(); //v.rx() *= scroller->pixelPerMeter().x(); //v.ry() *= scroller->pixelPerMeter().y(); PlotItem pi = { v, se->contentPos(), se->overshootDistance() }; addPlotItem(pi); } return QWidget::eventFilter(obj, ev); }