[PyQt] figuring out where keypress events go

Phil Thompson phil at riverbankcomputing.com
Fri Nov 11 10:06:35 GMT 2011


On Fri, 11 Nov 2011 10:50:21 +0100, Peter Bienstman
<Peter.Bienstman at ugent.be> wrote:
> Hi,
> 
> I want to customise handling of certain keys, but they never make it to
my 
> keyPressEvent handler, probably because they get processed by another
> object.
> 
> Is there an easy way to debug which objects these might be, such that I
> can 
> subclass them to ignore this keypress event?

Are the keys defined as shortcuts? If so you will need to handle the
ShortcutOverride event and accept the event for those keys that you want to
reach your keyPressEvent.

Phil


More information about the PyQt mailing list