hi all,
can anybody tell me what is worng with this code:
i have taken the code from this thread http://www.qtcentre.org/threads/4042...IntervalSymbol
i'm trying to draw a curve where every point will be with errorbars. but wen i run the code the programm crash.
messgraphFrame::messgraphFrame(QWidget *parent) :
QFrame(parent),
ui(new Ui::messgraphFrame)
{
ui->setupUi(this);
QVector<QwtIntervalSample> samples(3);
samples.append( QwtIntervalSample( 10 ,QwtInterval( 8, 12 )) );
samples.append( QwtIntervalSample( 2,QwtInterval( 3, 7 )) );
samples.append( QwtIntervalSample( 18,QwtInterval( 17, 20 )) );
QwtIntervalSymbol symbol( QwtIntervalSymbol::Bar );
// QwtPlot *myPlot = new QwtPlot( NULL );
QwtPlotIntervalCurve *curve1 = new QwtPlotIntervalCurve("Curve 1");
curve1->setSymbol( &symbol );
curve1->setSamples( samples );
curve1->attach(this->ui->qwtPlot);
// curve1->setStyle( QwtPlotIntervalCurve::Tube );
this->ui->qwtPlot->replot ();
}
i'm trying to draw a curve where every point will be with errorbars. but wen i run the code the programm crash.
messgraphFrame::messgraphFrame(QWidget *parent) :
QFrame(parent),
ui(new Ui::messgraphFrame)
{
ui->setupUi(this);
QVector<QwtIntervalSample> samples(3);
samples.append( QwtIntervalSample( 10 ,QwtInterval( 8, 12 )) );
samples.append( QwtIntervalSample( 2,QwtInterval( 3, 7 )) );
samples.append( QwtIntervalSample( 18,QwtInterval( 17, 20 )) );
QwtIntervalSymbol symbol( QwtIntervalSymbol::Bar );
// QwtPlot *myPlot = new QwtPlot( NULL );
QwtPlotIntervalCurve *curve1 = new QwtPlotIntervalCurve("Curve 1");
curve1->setSymbol( &symbol );
curve1->setSamples( samples );
curve1->attach(this->ui->qwtPlot);
// curve1->setStyle( QwtPlotIntervalCurve::Tube );
this->ui->qwtPlot->replot ();
}
To copy to clipboard, switch view to plain text mode
Bookmarks