Hi,
I need to sort of "relay" the keypress events from a widget (x) to another widget (y). Widget x does not contain any child. What it does is simply capture keypress events. Widget y contains a more complicated array of child widgets such as buttons, labels etc. Some of the buttons in Widget y have registered shortcuts. What I want to do is basically when the focus is on Widget x, whatever key I pressed, I can re-trigger it on widget y, so that the relevant buttons (with the relevant shortcut key) gets to handle it as usual.
Hope that someone can help on this. Thanks a lot.


Reply With Quote
Basically widget x is there as a "translucent screen" over a third party window (non-qt) embedded in my Qt Window to prevent it from receiving keyboard and mouse clicks. And effectively I want to direct the keyboard and mouse clicks intercepted by widget x to the main widget y so that they can be handled by the appropriate controls. For example, in widget y I have a button which registered shortcut F3. so when my focus is on widget x, and I press F3, I'm hoping that this button can handle it as if widget y is in focus. And because there are so many buttons within widget y with shortcuts, I was thinking the easiest way to do this is to sort of re-trigger the keypress event in widget y. Hope this makes sense. Anyway thanks, will come back to this thread if I encounter problems in my resolution.

Bookmarks