PDA

View Full Version : Transparency problem with stacked widgets



cybertron
21st November 2011, 02:46
Hi,

I've run into a problem with one of my Qt applications ever since I moved from 4.6 to 4.7. It's a monitoring application a bit like SuperKaramba, and it's possible to define transparent widgets that overlap (for example, an image overlaid on some text). The problem I'm having is that any time there is a widget over a text label, if the text on the label changes I get a flash of duplicated content. I've attached a screenshot that shows the problem. You can see there are spots where the translucent white overlay seems to be showing twice over a couple of text labels, particularly the top Mem and Net In labels. Those are the labels where the text just changed.

As I mentioned, this never happened on 4.6 so obviously something changed in 4.7 and I'm wondering if anyone has any idea what that would be. I've tried fiddling with different widget flags and such, but nothing I've tried has made a difference. I even tried erasing the entire window in the paint event to make sure nothing was being left over somehow.

Would appreciate any advice on this since it's incredibly annoying having something flickering in an app that's constantly on the screen like this. Thanks.

It appears the my image got resized when I uploaded it, so here's a link to the full version: http://www.nemebean.com/stuff/TransparencyProblem.png Also, the full source for the app can be found at https://github.com/cybertron/whee I can post some smaller code snippets if there's something in particular you're looking for.

cybertron
22nd December 2011, 04:04
FWIW, I did finally come up with a workaround for this. I hide the label, change the text, and then reshow the label. For some reason this eliminates the ghosting. It's a pretty vicious hack IMHO, but since I haven't found a better solution in the year or more since this started happening, I'll take it. :cool: