You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Tuesday, March 3rd 2009, 1:15pm

[Qt::WA_TranslucentBackground] How to paint without capturing events at painted places ?

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!

2

Tuesday, April 28th 2009, 10:31am

Hello,

I've got the same same problem (please have look at this posting):
Passing events to overlapped widgets

Have you found a solution by now?
I've described the same problem in several qt forums - but with no luck.

Denis

3

Tuesday, April 28th 2009, 11:15am

..just set the flag

this->setAttribute(Qt::WA_TransparentForMouseEvents);

in your Constructor

that's all. It took me over a week and about 5 forum postings to find out how it works ;-)