PDA

View Full Version : Widgets on Graphicsview backgrounds



pherthyl
23rd July 2008, 19:21
Hey everyone,

Just trying to put a few widgets onto my scene (using QGraphicsProxyWidget).. That works fairly well, but the problem is that those widgets draw their own background (ie, the style draws it), whereas I want the background to be transparent (so the scene background shows through).

I attached an example of how it looks.

Is there any way to tell it not to draw the widget background?

salmanmanekia
23rd July 2008, 19:47
QWidget::autoFillBackGround may be helpful...
for the background to be same as your view/scene see QPalette..
Hope it Helps..!!

pherthyl
23rd July 2008, 22:03
autoFillBackground didn't seem to have any effect, but setting Qt::WA_NoSystemBackground worked.

wysota
23rd July 2008, 22:24
Setting the background role of the palette to transparent would probably be sufficient.

macaco
29th July 2008, 18:02
I've run into this same problem, and this solution works fine on Windows, but not on Mac OS X. On OS X, I get a solid black background to any widget with this attribute (instead of truly transparent). On one widget, I've seen it behave even worse where the background is completely uninitialized so it's mostly black with some colored noise.

Anyone have experience with this on this platform?

Thanks.