class Chartwidget : public QChartView void Chartwidget::setBackground() { m_chart->setBackgroundVisible(false); //去背景 QColor color(255,255,255,0); QPalette pal(palette()); pal.setColor(QPalette::Window, color); setAutoFillBackground(true); QPen pen(color); this->setPalette(pal); }
标签:qt,color,背景,QPalette,QCharts,pal,255 From: https://www.cnblogs.com/RedWetPlace/p/17824329.html