I need to make a screen saver within a QApplication. I was wondering if there is a way to hook myself to the Application's event filter or something like that, so that I can know how much time has passed since the last event (keypressed, mouse event, whatever).

So far I have the widget I want to use as screen saver. Now I need to find a way to know "how much time has passed since the last event".

Any ideas on the subject?