首页 > 解决方案 > 如何在 QCustomPlot 中隐藏绘图区域?

问题描述

我正在使用QCustomPlot并且根据复选框的状态,我想隐藏或显示绘图区域(即QCustomPlot对象)。但是在我的插槽函数中,复选框状态更改了处理程序,当我用or隐藏QCustomPlot对象时,它会给出以下错误hide()setVisible(false)

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

请注意,隐藏时我不会调用replot()该对象,那么问题是什么,如何正确隐藏该对象?

标签: c++qtqtwidgetsqcustomplot

解决方案


推荐阅读