Qt4: Unresolved timer events

前端 未结 1 1116
自闭症患者
自闭症患者 2021-01-24 09:26

A mini sample file main.cpp:

#include 
#include 

class MyApp : public QCoreApplication
{
private:
    int m         


        
1条回答
  •  再見小時候
    2021-01-24 10:01

    Your fifteen second wait will not accumulate timer events because your timerEvent code blocks waiting for the input. Qt can't get back into its event loop until you enter the input. When it does get back to the event loop it checks the elapsed time and notices that more than 3 seconds have elapsed and so it fires off a timer event. The fact that fifteen seconds has elapsed is irrelevant.

    This is the expected behaviour and will not (should not) be platform-dependent.

    0 讨论(0)
提交回复
热议问题