You can either set an event filter on the application object and monitor the flow of events through your program or you can tap into QAbstractEventDispatcher somehow and do the same.