QCustomPlot绘图注意事项

1、关于QCustomPlot背景色(透明)

QCustomPlot绘图注意事项

QCustomPlot将其背景设置成透明色,需要先给QCustomPlot设置一个父控件,然后添加代码:

ui->customplot->setBackground(Qt::transparent);

ui->customplot->setStyleSheet("background: transparent;");

上面两行看起来是差不多作用,但是如果只设置其中一个是达不到背景色透明的,猜测可能跟QChart相似有个图层,需要将图层跟绘图层均设置成透明色才能达到背景色透明。