QCustomPlot Discussion and Comments

How to hide QCustomPlot object?Return to overview

I am using QCustomPlot and depending on the state of the checkbox, I want to hide or show the plot area (i.e. QCustomPlot object). But in my slot function, checkbox state changed handler, when I hide the QCustomPlot object with hide() or setVisible(false), it gives the following errors

Sorry I accidentally sent the post without completing it.
It gives the following errors

QPainter::begin: Paint device returned engine == 0, type: 2
QPainter::setRenderHint: Painter must be active to set rendering hints
void QCPLayer::drawToPaintBuffer() paint buffer returned inactive painter

Note that I do not call replot() on that object when it is hidden, so what is the problem, and how can I properly hide the object?