I was going to post the same question.
Right now I use std::unique_ptr because I don't know if the memory is managed when you use .attach()
Example:
grid->setPen( Qt::gray, 0.0, Qt::DotLine );
grid->enableX( true );
grid->enableXMin( true );
grid->enableY( true );
grid->enableYMin( false );
grid->attach( this ); //will grid pointer be deleted also?
QwtPlotGrid *grid = new QwtPlotGrid();
grid->setPen( Qt::gray, 0.0, Qt::DotLine );
grid->enableX( true );
grid->enableXMin( true );
grid->enableY( true );
grid->enableYMin( false );
grid->attach( this ); //will grid pointer be deleted also?
To copy to clipboard, switch view to plain text mode
In the qwt examples, it seems .attach does the memory management, because I see no delete whatsoever in the code.
let see if we can get a confirm, it's not in the .attach documentation
Bookmarks