本文整理汇总了C++中QwtPlotCanvas类的典型用法代码示例。如果您正苦于以下问题:C++ QwtPlotCanvas类的具体用法?C++ QwtPlotCanvas怎么用?C++ QwtPlotCanvas使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QwtPlotCanvas类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QwtPlot
Plotter::Plotter( QWidget *parent ):
QwtPlot( parent )
{
// Assign a title
setTitle( "WAVE DATA" );
QwtPlotCanvas *canvas = new QwtPlotCanvas();
canvas->setFrameStyle( QFrame::Box | QFrame::Plain );
canvas->setLineWidth( 1 );
canvas->setPalette( Qt::white );
setCanvas( canvas );
alignScales();
// Insert grid
d_grid = new QwtPlotGrid();
d_grid->attach( this );
// Axis
setAxisTitle( QwtPlot::xBottom, "Time" );
// setAxisScale( QwtPlot::xBottom, -d_interval, 0.0 );
setAxisTitle( QwtPlot::yLeft, "Amplitude" );
// setAxisScale( QwtPlot::yLeft, -1.0, 1.0 );
resize(600, 350);
}
示例2: plot
void Editor::setItemVisible( QwtPlotShapeItem *item, bool on )
{
if ( plot() == NULL || item == NULL || item->isVisible() == on )
return;
const bool doAutoReplot = plot()->autoReplot();
plot()->setAutoReplot( false );
item->setVisible( on );
plot()->setAutoReplot( doAutoReplot );
/*
Avoid replot with a full repaint of the canvas.
For special combinations - f.e. using the
raster paint engine on a remote display -
this makes a difference.
*/
QwtPlotCanvas *canvas =
qobject_cast<QwtPlotCanvas *>( plot()->canvas() );
if ( canvas )
canvas->invalidateBackingStore();
plot()->canvas()->update( maskHint( item ) );
}
示例3: foreach
foreach(QWidget *w, d_widgets){
QwtPlotCanvas *canvas = qobject_cast<QwtPlotCanvas *>(w);
if (canvas){
((Graph*)canvas->parent())->raiseEnrichements();
break;
}
}
示例4: QwtPlot
// MyPlot2D::MyPlot2D(QWidget *parent, const char *name)
MyPlot2D::MyPlot2D( QWidget *parent ):
QwtPlot(parent) {
setAutoReplot( false );
setTitle( "Comparison of WATER FIT against Measurements" );
QwtPlotCanvas *canvas = new QwtPlotCanvas();
canvas->setBorderRadius( 10 );
setCanvas( canvas );
setCanvasBackground( QColor( "LightGray" ) );
// legend
// QwtLegend *legend = new QwtLegend;
// insertLegend( legend, QwtPlot::BottomLegend );
// grid
QwtPlotGrid *grid = new QwtPlotGrid;
grid->enableXMin( true );
grid->setMajorPen( Qt::white, 0, Qt::DotLine );
grid->setMinorPen( Qt::gray, 0 , Qt::DotLine );
grid->attach( this );
// axes
enableAxis( QwtPlot::yRight );
setAxisTitle( QwtPlot::xBottom, "Distance from CAX (cm)" );
setAxisTitle( QwtPlot::yLeft, "Relative Output Factor" );
// setAxisTitle( QwtPlot::yRight, "Phase [deg]" );
// setAxisMaxMajor( QwtPlot::xBottom, 6 );
// setAxisMaxMinor( QwtPlot::xBottom, 9 );
// setAxisScaleEngine( QwtPlot::xBottom, new QwtLogScaleEngine );
setAutoReplot( true );
}
示例5: QwtPlot
BarChart::BarChart( QWidget *parent ):
QwtPlot( parent )
{
const struct
{
const char *distro;
const int hits;
QColor color;
} pageHits[] =
{
{ "Arch", 1114, QColor( "DodgerBlue" ) },
{ "Debian", 1373, QColor( "#d70751" ) },
{ "Fedora", 1638, QColor( "SteelBlue" ) },
{ "Mageia", 1395, QColor( "Indigo" ) },
{ "Mint", 3874, QColor( 183, 255, 183 ) },
{ "openSuSE", 1532, QColor( 115, 186, 37 ) },
{ "Puppy", 1059, QColor( "LightSkyBlue" ) },
{ "Ubuntu", 2391, QColor( "FireBrick" ) }
};
setAutoFillBackground( true );
setPalette( QColor( "Linen" ) );
QwtPlotCanvas *canvas = new QwtPlotCanvas();
canvas->setLineWidth( 2 );
canvas->setFrameStyle( QFrame::Box | QFrame::Sunken );
canvas->setBorderRadius( 10 );
QPalette canvasPalette( QColor( "Plum" ) );
canvasPalette.setColor( QPalette::Foreground, QColor( "Indigo" ) );
canvas->setPalette( canvasPalette );
setCanvas( canvas );
setTitle( "DistroWatch Page Hit Ranking, April 2012" );
d_barChartItem = new DistroChartItem();
QVector< double > samples;
for ( uint i = 0; i < sizeof( pageHits ) / sizeof( pageHits[ 0 ] ); i++ )
{
d_distros += pageHits[ i ].distro;
samples += pageHits[ i ].hits;
d_barChartItem->addDistro(
pageHits[ i ].distro, pageHits[ i ].color );
}
d_barChartItem->setSamples( samples );
d_barChartItem->attach( this );
insertLegend( new QwtLegend() );
setOrientation( 0 );
setAutoReplot( false );
}
示例6: canvas
//! Return plot widget, containing the observed plot canvas
QwtPlot *QwtPlotMagnifier::plot()
{
QwtPlotCanvas *w = canvas();
if ( w )
return w->plot();
return NULL;
}
示例7: canvas
//! Return plot widget, containing the observed plot canvas
QwtPlot *QwtPlotPicker::plot()
{
QwtPlotCanvas *w = canvas();
if ( w )
return w->plot();
return NULL;
}
示例8: Plot
Plot( QWidget *parent = NULL ):
QwtPlot( parent )
{
QwtPlotCanvas *canvas = new QwtPlotCanvas();
canvas->setLineWidth( 1 );
canvas->setFrameStyle( QFrame::Box | QFrame::Plain );
setCanvas( canvas );
}
示例9: QObject
CanvasPicker::CanvasPicker(Graph *graph):
QObject(graph)
{
pointSelected = false;
d_editing_marker = 0;
QwtPlotCanvas *canvas = graph->canvas();
canvas->installEventFilter(this);
}
示例10: myReplot
void caWaterfallPlot::myReplot()
{
#if QWT_VERSION >= 0x060100
QwtPlotCanvas *canvas = (QwtPlotCanvas *) plot->canvas();
canvas->replot();
#else
plot->canvas()->replot();
#endif
}
示例11: QWidget
SelectionMoveResizer::SelectionMoveResizer(QWidget *target)
: QWidget(target->parentWidget())
{
QwtPlotCanvas *canvas = qobject_cast<QwtPlotCanvas *>(target);
if (canvas)
setParent(canvas->plot()->parentWidget());
init();
add(target);
}
示例12: QObject
CanvasPicker::CanvasPicker( QwtPlot* plot ): QObject( plot ), m_isEnabled( false ), m_dragAndDropInProgress( false ),
m_typeOfItemsToDrag( -1 ), m_itemToPick( 0 )
{
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>( plot->canvas() );
canvas->installEventFilter( this );
m_isEnabled = true;
canvas->setFocusPolicy( Qt::StrongFocus );
canvas->setFocusIndicator( QwtPlotCanvas::ItemFocusIndicator );
canvas->setFocus();
}
示例13: plot
void CanvasPicker::setEnabled( bool enabled )
{
if( m_isEnabled != enabled )
{
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>( plot()->canvas() );
m_isEnabled = enabled;
if( enabled )
canvas->installEventFilter( this );
else
canvas->removeEventFilter( this );
}
}
示例14: onBorderRadiusChanged
void SAChartNormalSetWidget::onBorderRadiusChanged(double v)
{
if(ui->chart)
{
QWidget* w = ui->chart->canvas();
QwtPlotCanvas* canvas = qobject_cast<QwtPlotCanvas*>(w);
if(canvas)
{
canvas->setBorderRadius(v);
ui->chart->replot();
}
}
}
示例15: setupExpoPlot
void ConfigStabilizationWidget::setupExpoPlot()
{
ui->expoPlot->setMouseTracking(false);
ui->expoPlot->setAxisScale(QwtPlot::xBottom, 0, 100, 25);
QwtText title;
title.setText(tr("Input %"));
title.setFont(ui->expoPlot->axisFont(QwtPlot::xBottom));
ui->expoPlot->setAxisTitle(QwtPlot::xBottom, title);
ui->expoPlot->setAxisScale(QwtPlot::yLeft, 0, 100, 25);
title.setText(tr("Output %"));
title.setFont(ui->expoPlot->axisFont(QwtPlot::yLeft));
ui->expoPlot->setAxisTitle(QwtPlot::yLeft, title);
QwtPlotCanvas *plotCanvas = dynamic_cast<QwtPlotCanvas *>(ui->expoPlot->canvas());
if (plotCanvas) {
plotCanvas->setFrameStyle(QFrame::NoFrame);
}
ui->expoPlot->canvas()->setCursor(QCursor());
m_plotGrid.setMajorPen(QColor(Qt::gray));
m_plotGrid.setMinorPen(QColor(Qt::lightGray));
m_plotGrid.enableXMin(false);
m_plotGrid.enableYMin(false);
m_plotGrid.attach(ui->expoPlot);
m_expoPlotCurveRoll.setRenderHint(QwtPlotCurve::RenderAntialiased);
QColor rollColor(Qt::red);
rollColor.setAlpha(180);
m_expoPlotCurveRoll.setPen(QPen(rollColor, 2));
m_expoPlotCurveRoll.attach(ui->expoPlot);
replotExpoRoll(ui->expoSpinnerRoll->value());
m_expoPlotCurveRoll.show();
QColor pitchColor(Qt::green);
pitchColor.setAlpha(180);
m_expoPlotCurvePitch.setRenderHint(QwtPlotCurve::RenderAntialiased);
m_expoPlotCurvePitch.setPen(QPen(pitchColor, 2));
m_expoPlotCurvePitch.attach(ui->expoPlot);
replotExpoPitch(ui->expoSpinnerPitch->value());
m_expoPlotCurvePitch.show();
QColor yawColor(Qt::blue);
yawColor.setAlpha(180);
m_expoPlotCurveYaw.setRenderHint(QwtPlotCurve::RenderAntialiased);
m_expoPlotCurveYaw.setPen(QPen(yawColor, 2));
m_expoPlotCurveYaw.attach(ui->expoPlot);
replotExpoYaw(ui->expoSpinnerYaw->value());
m_expoPlotCurveYaw.show();
}