I'm using QCustomPlot
and have sub-classed QCPGraph
in order to provide a drawable graph.
class QCPDrawableGraph : public QCPGraph {
Q_OBJECT
public:
QCPDrawableGraph(QCPAxis* x, QCPAxis* y) : QCPGraph(x,y) {
//do stuff
}
virtual ~QCPDrawabelGraph() {} // necessary?
//class stuff
};
Usually, one would create new graphs by
QCustomPlot plot(parent); //where parent is the parent widget of the gui
QCPGraph* gr = plot->addGraph(); // in case of QCPGraphs or
QCPGraph* gr = new QCPGraph(plot->xAxis,plot->yAxis); // as with all other QCPAbstractPlottables
Would I use my own class just like
QCPDrawableGraph* dgr = new QCPDrawableGraph(plot->xAxis,plot->yAxis); //?
Does the destructor of QCustomPlot
still take care of the de-allocation in the end?