Originally Posted by
Harm
I just inserted the plot widget, start the application, open the dialog, close it via close button and get a crash. I will try to implement some data though. Propably the lib is only shy because of painting a blank diagram.
Ok, drilled through the code a littlebit. I inserted some code in the constructor to have some data displayed.
Q_GraphView
::Q_GraphView(QWidget *parent
){
ui.setupUi(this);
QVector<QPointF> averageData;
averageData.
push_back( QPointF(0,
0) );
averageData.
push_back( QPointF(1,
1) );
averageData.
push_back( QPointF(2,
5) );
curve
->setRenderHint
( QwtPlotItem::RenderAntialiased );
symbol->setSize( 4 );
curve->setSymbol( symbol );
curve->setSamples( averageData );
curve->attach( ui.PlotArea );
Q_GraphView::Q_GraphView(QWidget *parent)
: QDialog(parent)
{
ui.setupUi(this);
QVector<QPointF> averageData;
averageData.push_back( QPointF(0,0) );
averageData.push_back( QPointF(1,1) );
averageData.push_back( QPointF(2,5) );
QwtPlotCurve *curve = new QwtPlotCurve( "Test" );
curve->setRenderHint( QwtPlotItem::RenderAntialiased );
QwtSymbol *symbol = new QwtSymbol( QwtSymbol::XCross );
symbol->setSize( 4 );
symbol->setPen( QPen( QColor( "red" ) ) );
curve->setSymbol( symbol );
curve->setSamples( averageData );
curve->attach( ui.PlotArea );
To copy to clipboard, switch view to plain text mode
What I found out is the following: the data displays well, so far all ok, but the programm crashs in the destructor of the qwtplot. I will hunt in the detachItems now, because it seems that my problem is buried somewhere in there.
Bookmarks