void SlotPlot::test1_Gnats5737()
{
myPlot->setWindowTitle ("Step Curve Clipping, Qwt 6.1.2");
myPlot->resize (520, 220);
curve1->setSamples (dataPoly);
curve2->setSamples (dataPoly.translated (70.0, 0.0));
curve3->setSamples (dataPoly.translated (140.0, 0.0));
curve4->setSamples (dataPoly.translated (210.0, 0.0));
QPen curvePen
(Qt
::black);
curvePen.setWidth (4);
curve1->setPen (curvePen);
curve2->setPen (curvePen);
curve3->setPen (curvePen);
curve4->setPen (curvePen);
curve3
->setRenderHint
(QwtPlotItem::RenderAntialiased,
true);
curve4
->setRenderHint
(QwtPlotItem::RenderAntialiased,
true);
const QPen symP
(Qt
::blue);
curve1->attach (myPlot);
curve2->attach (myPlot);
curve3->attach (myPlot);
curve4->attach (myPlot);
// Zoom vertically every other invocation
static int callCnt (0);
if ((++callCnt % 2) != 0)
{
myPlot
->setAxisScale
(QwtPlot::yLeft,
0.0,
50.0);
myPlot->updateAxes();
}
// finally, refresh the plot
myPlot->replot();
myPlot->show();
}
void SlotPlot::test1_Gnats5737()
{
QwtPlot* myPlot = new QwtPlot (NULL);
myPlot->setWindowTitle ("Step Curve Clipping, Qwt 6.1.2");
myPlot->resize (520, 220);
QPolygonF dataPoly;
dataPoly << QPointF (10.0, 0.0)
<< QPointF (20.0, 0.0)
<< QPointF (30.0, 90.0)
<< QPointF (40.0, 45.0)
<< QPointF (50.0, 0.0)
<< QPointF (60.0, 0.0);
QwtPlotCurve* curve1 = new QwtPlotCurve ("Curve 1");
QwtPlotCurve* curve2 = new QwtPlotCurve ("Curve 2");
QwtPlotCurve* curve3 = new QwtPlotCurve ("Curve 3");
QwtPlotCurve* curve4 = new QwtPlotCurve ("Curve 4");
curve1->setSamples (dataPoly);
curve2->setSamples (dataPoly.translated (70.0, 0.0));
curve3->setSamples (dataPoly.translated (140.0, 0.0));
curve4->setSamples (dataPoly.translated (210.0, 0.0));
QPen curvePen (Qt::black);
curvePen.setWidth (4);
curve1->setPen (curvePen);
curve2->setPen (curvePen);
curve3->setPen (curvePen);
curve4->setPen (curvePen);
curve1->setStyle (QwtPlotCurve::Lines);
curve2->setStyle (QwtPlotCurve::Steps);
curve3->setStyle (QwtPlotCurve::Lines);
curve4->setStyle (QwtPlotCurve::Steps);
curve3->setRenderHint (QwtPlotItem::RenderAntialiased, true);
curve4->setRenderHint (QwtPlotItem::RenderAntialiased, true);
const QBrush symB (Qt::red);
const QPen symP (Qt::blue);
const QSize symS (8,8);
curve1->setSymbol (new QwtSymbol (QwtSymbol::Ellipse, symB, symP, symS));
curve2->setSymbol (new QwtSymbol (QwtSymbol::Ellipse, symB, symP, symS));
curve3->setSymbol (new QwtSymbol (QwtSymbol::Ellipse, symB, symP, symS));
curve4->setSymbol (new QwtSymbol (QwtSymbol::Ellipse, symB, symP, symS));
curve1->attach (myPlot);
curve2->attach (myPlot);
curve3->attach (myPlot);
curve4->attach (myPlot);
// Zoom vertically every other invocation
static int callCnt (0);
if ((++callCnt % 2) != 0)
{
myPlot->setAxisScale (QwtPlot::yLeft, 0.0, 50.0);
myPlot->updateAxes();
}
// finally, refresh the plot
myPlot->replot();
myPlot->show();
}
To copy to clipboard, switch view to plain text mode
Bookmarks