sebastian.f
14th May 2009, 12:22
Hello,
I have a bit of a problem with my Qt Widget.
The way it works is I have a button (the base) that does some clever stuff depending on movements of the mouse in and around it.
To instruct users on what to do there is an overlay (a subclassed QWidget) (significantly larger than the button) that is displayed as long as the button is held down.
The base creates, shows & hides the overlay but because its so much larger, the overlay sets its parent to that of the main application (the bases parent).
The problem now arises as I try and add a slight delay, so that the overlay lingers for a moment before it disappears; in this case, if the user releases the mouse and tries to click again, the overlay catches the mouse event locking the user out of the control until it vanishes.
Of course Ignore() passes the mouse events to the parent, but because my overlay makes itself the sibling of the base control I want to handle the mouse event, this doesn't work.
Could anyone tell me how to make my widget 'transparent' to mouse events so they are passed to the widget behind, instead of to the parent?
Thanks!
I have a bit of a problem with my Qt Widget.
The way it works is I have a button (the base) that does some clever stuff depending on movements of the mouse in and around it.
To instruct users on what to do there is an overlay (a subclassed QWidget) (significantly larger than the button) that is displayed as long as the button is held down.
The base creates, shows & hides the overlay but because its so much larger, the overlay sets its parent to that of the main application (the bases parent).
The problem now arises as I try and add a slight delay, so that the overlay lingers for a moment before it disappears; in this case, if the user releases the mouse and tries to click again, the overlay catches the mouse event locking the user out of the control until it vanishes.
Of course Ignore() passes the mouse events to the parent, but because my overlay makes itself the sibling of the base control I want to handle the mouse event, this doesn't work.
Could anyone tell me how to make my widget 'transparent' to mouse events so they are passed to the widget behind, instead of to the parent?
Thanks!