[Interest] QTableWidget::setCellWidget() overrides widget's palette?

Murphy, Sean smurphy at walbro.com
Sat Apr 21 00:52:38 CEST 2018

> > But the issue only comes up with the plots that are embedded into the
> table. The standalone plot has the color palette I want, and
> > the palette is being set in the plot class' constructor, so it should be the
> same palette for all 3 plots.
> Yea, didn't think that was it.
> One ugly workaround I found that seems to work:
>     auto palette = canvas()->palette();
>     palette.setBrush(QPalette::Base, QBrush(QColor(50,50,50)));
>     canvas()->setPalette(palette);

Thanks so much for finding that solution! After my last email, I had tried
setting it with QPalette::Window, but didn't try Base.

> Instead of
>     setCanvasBackground(QBrush(QColor(50,50,50)));
> Still don't understand why that won't work though.

I don't either, but at this point it works the way I want it to, so that's good enough
for me!

Thanks again, 

This message has been scanned for malware by Forcepoint. www.forcepoint.com

More information about the Interest mailing list