This question might be related to those questions:
- QEventLoop: get time when an event was scheduled
- Get the timestamp when a QInputEvent was put onto the queue of the QEventLoop in Qt 4.8
I would like to detect if a user input is older than a certain timeout and block such events if necessary. Imagine scenarios where the UI is not responsive and hangs in the main thread for a few seconds and the user keeps sending input events. Those events are queued and are then processed with a certain delay. I would like to catch this and be able to discard/ignore them. I know that this should never happen since a UI should always be responsive and long tasks should be moved to worker threads or similar concepts but I still want to be able to detect such rare scenarios. Note that the same could happen when the system itself freezes for a few seconds, maybe due to high burden on the system as a whole.