本文整理汇总了C++中QwtPlotCanvas::plot方法的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCanvas::plot方法的具体用法?C++ QwtPlotCanvas::plot怎么用?C++ QwtPlotCanvas::plot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QwtPlotCanvas
的用法示例。
在下文中一共展示了QwtPlotCanvas::plot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canvas
//! Return plot widget, containing the observed plot canvas
QwtPlot *QwtPlotPicker::plot()
{
QwtPlotCanvas *w = canvas();
if ( w )
return w->plot();
return NULL;
}
示例2: canvas
//! Return plot widget, containing the observed plot canvas
QwtPlot *QwtPlotMagnifier::plot()
{
QwtPlotCanvas *w = canvas();
if ( w )
return w->plot();
return NULL;
}
示例3: QWidget
SelectionMoveResizer::SelectionMoveResizer(QWidget *target)
: QWidget(target->parentWidget())
{
QwtPlotCanvas *canvas = qobject_cast<QwtPlotCanvas *>(target);
if (canvas)
setParent(canvas->plot()->parentWidget());
init();
add(target);
}
示例4: appendData
void IncrementalPlot::appendData(double *x, double *y, int size) {
if (d_data == NULL) d_data = new CurveData;
if (d_curve == NULL) {
d_curve = new QwtPlotCurve("Data");
d_curve->setStyle(QwtPlotCurve::NoCurve);
d_curve->setPaintAttribute(QwtPlotCurve::FilterPoints, true);
const QColor &c = Qt::white;
QwtSymbol *symbol = new QwtSymbol(QwtSymbol::Ellipse);
symbol->setBrush(QBrush(c));
symbol->setPen(QPen(c));
symbol->setSize(QSize(6, 6));
d_curve->setSymbol(symbol);
d_curve->attach(this);
}
d_data->append(x, y, size);
d_curve->setRawSamples(d_data->x(), d_data->y(), d_data->count());
#ifdef __GNUC__
#warning better use QwtData
#endif
const bool cacheMode = qobject_cast<QwtPlotCanvas *>(canvas())->testPaintAttribute(QwtPlotCanvas::BackingStore);
#if QT_VERSION >= 0x040000 && defined(Q_WS_X11)
// Even if not recommended by TrollTech, Qt::WA_PaintOutsidePaintEvent
// works on X11. This has an tremendous effect on the performance..
canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, true);
#endif
QwtPlotCanvas *plotCanvas = qobject_cast<QwtPlotCanvas *>(canvas());
plotCanvas->setPaintAttribute(QwtPlotCanvas::BackingStore, false);
QPainter painter;
QwtScaleMap xMap = plotCanvas->plot()->canvasMap(d_curve->xAxis());
QwtScaleMap yMap = plotCanvas->plot()->canvasMap(d_curve->yAxis());
d_curve->drawSeries(&painter, xMap, yMap, (d_curve->paintRect(xMap, yMap)), d_curve->dataSize() - size, d_curve->dataSize() -1);
plotCanvas->setPaintAttribute(QwtPlotCanvas::BackingStore, cacheMode);
#if QT_VERSION >= 0x040000 && defined(Q_WS_X11)
canvas()->setAttribute(Qt::WA_PaintOutsidePaintEvent, false);
#endif
}