Nominate our 2022 Qt Champions!

Receiving QTimer events but no others

  • Windows reports my application as "(not responding)", but in the logs I can see that I am processing (short) QTimer events every half-second. Between the QTimer events there is by far enough time to process the event queue, but somehow it isn't happening.
    I don't have any QEventLoop instances other than QApplication and no modal windows (both of which might block user input but let QTimer events through).

    Does anyone of you know what else in Qt might block anything but QTimer events? I'm assuming here that Windows says (not responding) because the windows message queue isn't being processed by my application.

  • Moderators

    Debug and see what really is the root of this problem. A thought that comes to mind is: you can force event loop run by using qApp->processEvents().

  • Thanks, but the problem occurs only once a week so it is hard to debug. Also, we don't use processEvents at all because of the inherent re-entrancy. So I'm really looking for a brainstorm here.

  • Moderators

    If it's a large program, it could be anything. Even commercially-released programs hang now and then.

    Did you start other threads?

    Are you using 3rd-party libraries?

  • I would suggest you wait until it happens once again (but don't terminate the process!) and then you load up a debugger, let it connect to the process and trigger a debug break + stack trace. Then you should see where it is "hanging". You'll need to compile your app with debug symbols to get a meaningful stack trace though...

Log in to reply