QCPAxisRect *windowAxisRect = new QCPAxisRect(customPlotObj);
chartPlot->plotLayout()->addElement(1, 0, subLayout);
The above line adds the QCPAxis rect to the chartplot.
To delete this when I do
delete windowAxisRect then it throws an error.
How to delete this object?
Also if there are any ways I can detach this windowAxisRect from customplot at runtime?