QCustomPlot Discussion and Comments

Detaching QCPAxisRectReturn to overview

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?

Hi God,
I recommend reading the documentation of QCPAxisRect, or for your purpose, better the documentation of QCPLayoutElement. I think the methods you're looking for are called remove and take.