[Qt-interest] click-through qwidget?
Glenn Hughes
ghughes02138 at gmail.com
Wed Aug 4 00:14:08 CEST 2010
Hi everyone...
There must be some way to do this. I have a qwidget subclass which is
essentially an overlay (NOT an OpenGL overlay, just an overlay over
regular widgets) over some other widgets. I'm inserting it into the
parent widget after its layout has been set, and explicitly resizing
it to stay in sync with the parent's geometry in the parent's
resizeEvent method.
The problem is that clicks, and I'm assuming other events, don't get
dispatch to the "real" child widgets. Strangely redraw events DO get
dispatched, so graphically everything is working correctly... the only
problem is if the overly is in place I can't interact with the
underlying child widgets at all.
So, is there some way to make a widget essentially "transparent" to
clicks (except of course if the click lands on something I'm actually
drawing in the overly). In other words, how do I do my own hit testing
within the widget? I've tried even overriding "event" in my overlay
widget and simply ignoring everything and returning false for
everything (as an experiment). Doesn't help a bit. Still can't click
on the underlying widgets.
There must be a simple explanation for this... You've been able to
have non-rectangular widgets since Qt 4 I believe, so there must be
some way of allow events through the "transparent" areas.
Help?
Thanks in advance
Glenn
More information about the Qt-interest-old
mailing list