[Interest] [External] QGraphicsProxyWidget not honoring embedded widget's palette

Murphy, Sean Sean.Murphy at centauricorp.com
Mon Feb 21 21:25:10 CET 2022

> If, however, I move that same widget onto a QGraphicsScene via
>     fooWidget* foo = new fooWidget();
>     foo->setFooData(data);
>     QGraphicsProxyWidget* proxy = scene->addWidget(foo) The fooWidget is
> properly added to the scene, all of its child widgets' text values are correctly
> updated based on whatever is in "data", BUT the widget background colors
> are not updated - they are just the default values as if I hadn't attempted to
> change the palette.
> Any way for me to get QGraphicsProxyWidget to honor the embedded
> widget's palette? Using Qt 5.15.2 if that matters...

Quick self-update here, it looks like it has something to do with QLabels that
I had modified to have a frameShape of StyledPanel. If I switch those back to 
having the default frameShape of NoFrame, then they are painted  correctly 
regardless of whether they are out in my MainWindow hierarchy, or whether 
they are wrapped inside of a QGraphicsProxyWidget, although now I've lost 
the frame border that I wanted. Looks like I'll just have to write a custom stylesheet 
that updates based on the fooData parameters.


More information about the Interest mailing list