PDA

View Full Version : KeyEvent to go to a parent/grandparent widget?



thomaspu
28th December 2007, 23:45
Whats the best practice for sending up a keypress event to a widget that is probably its parent or grandparent?

I've got a TabWidget that contains pages consisting of SSHWidget's. Now those SSHWidgets have a class inside them called Console. I wanted the user to be able to press Shift + Left and make my TabWidget move to the next tab. So I'm not sure if I should get a pointer in Console to the TabWidget, or if I should let the keyPress propagate up... or is there a better way? I hope that makes sense!

Paul

jpn
28th December 2007, 23:48
An ignored (http://doc.trolltech.com/latest/qevent.html#ignore) key event should get propagated to receiver's parent.

thomaspu
29th December 2007, 03:07
Yeah, that was def a cleaner way to do it.

Paul