PDA

View Full Version : [Qt::WA_TranslucentBackground] How to paint without capturing events at painted place



SeppeVanNolle
3rd March 2009, 15:38
Hi,

I'm using the new Qt::WA_TranslucentBackground (Qt4.5) attribute to create a semi-transparent toplevel widget. By default, the QWidget grabs mouse events wherever my paintevents paint something (ie. auto-mask). But I want to let mouse events pass through my widget at certain places where I paint (eg. a drop shadow of a frame should not get mouse events). I tried calling QEvent::ignore() is the mouse event handlers of my widget, but that does not cause the event to propagate to the underlying non-Qt windows. I also looked at the widget flag WA_PaintOnScreen, but that does not seem to work in combination with WA_TranslucentBackground.

Does anybody know how to do what I want to achieve?

Thanks!