thanks Uwe fot your patience and answers.
btw the error was genereate by 2 different elements:
first-> you allocation procedure is correct, it works perfectly
second-> if I want to use different curves i must initialize also differen symbols
the error was genereated because i initilized just 1 simbol, using it for all the curves.. So during the closing procedure, when first curve is deallocated the program looses the reference to the simbol (pointer) stored in the other curves..
here the working code
for ( int i = 0; i < 100; i++ ){
curves
[i
]->setPen
( QPen( Qt
::yellow,
1 ) ), curves
[i
]->setRenderHint
( QwtPlotItem::RenderAntialiased,
true );
curves[i]->setSymbol( Curves_Symbol[i] );
}
QwtPlotCurve *curves[100];
QwtSymbol *Curves_Symbol[100];
for ( int i = 0; i < 100; i++ ){
curves[i] = new QwtPlotCurve();
Curves_Symbol[i] = new QwtSymbol( QwtSymbol::Cross, QBrush( Qt::yellow ), QPen( Qt::yellow, 2 ), QSize( 2, 2 ) );
curves[i]->setPen( QPen( Qt::yellow, 1 ) ), curves[i]->setRenderHint( QwtPlotItem::RenderAntialiased, true );
curves[i]->setSymbol( Curves_Symbol[i] );
curves[i]->attach( ui.qwtPlot );
}
To copy to clipboard, switch view to plain text mode
Tnx again.
Bookmarks