IncrementalPlot( parent ),
d_timer( 0 )
{
enableAxis(xBottom,false);
enableAxis(yLeft,false);
setAxisMaxMajor(xBottom,17);
setAxisMaxMajor(yLeft,10);
d_rescaler = new QwtPlotRescaler( canvas() );
d_rescaler
->setReferenceAxis
( QwtPlot::xBottom );
d_rescaler
->setAspectRatio
( QwtPlot::yLeft,
1.0 );
d_rescaler
->setAspectRatio
( QwtPlot::yRight,
0.0 );
d_rescaler
->setAspectRatio
( QwtPlot::xTop,
0.0 );
d_rescaler->setRescalePolicy( QwtPlotRescaler::Expanding );
d_rescaler->setEnabled( true );
d_rescaler->rescale();
plotLayout()->setAlignCanvasToScales( true );
grid->setMajorPen( Qt::black, 0, Qt::SolidLine );
grid->attach( this );
setCanvasBackground( Qt::gray );
setAxisScale( xBottom, 0, 1000 );
setAxisScale( yLeft, 0, 1000 );
canvas()->setMouseTracking(true);
replot();
// panning with the left mouse button
// zoom in/out with the wheel
magnifier->setMouseButton( Qt::NoButton );
}
Plot::Plot( QWidget *parent ):
IncrementalPlot( parent ),
d_timer( 0 )
{
enableAxis(xBottom,false);
enableAxis(yLeft,false);
setAxisMaxMajor(xBottom,17);
setAxisMaxMajor(yLeft,10);
d_rescaler = new QwtPlotRescaler( canvas() );
d_rescaler->setReferenceAxis( QwtPlot::xBottom );
d_rescaler->setAspectRatio( QwtPlot::yLeft, 1.0 );
d_rescaler->setAspectRatio( QwtPlot::yRight, 0.0 );
d_rescaler->setAspectRatio( QwtPlot::xTop, 0.0 );
d_rescaler->setRescalePolicy( QwtPlotRescaler::Expanding );
d_rescaler->setEnabled( true );
d_rescaler->rescale();
plotLayout()->setAlignCanvasToScales( true );
QwtPlotGrid *grid = new QwtPlotGrid;
grid->setMajorPen( Qt::black, 0, Qt::SolidLine );
grid->attach( this );
setCanvasBackground( Qt::gray );
setAxisScale( xBottom, 0, 1000 );
setAxisScale( yLeft, 0, 1000 );
canvas()->setMouseTracking(true);
replot();
// panning with the left mouse button
new QwtPlotPanner( canvas() );
// zoom in/out with the wheel
QwtPlotMagnifier *magnifier = new QwtPlotMagnifier( canvas() );
magnifier->setMouseButton( Qt::NoButton );
picker = new QwtPlotPicker(QwtPlot::xBottom, QwtPlot::yLeft,QwtPlotPicker::CrossRubberBand, QwtPicker::AlwaysOn,canvas());
}
To copy to clipboard, switch view to plain text mode
Bookmarks