Qt之利用系统空闲

Qt之利用系统空闲

如何利用系统空闲,处理指定函数?

To make your application perform idle processing (by executing a special function whenever there are no pending events), use a QTimer with 0 timeout. More advanced idle processing schemes can be achieved using processEvents().

  • 方法1 使用int QObject::startTimer(int interval, Qt::TimerType timerType = Qt::CoarseTimer)

If interval is 0, then the timer event occurs once every time there are no more window system events to process.

  • 方法2 在处理函数中调用processEvents(),这样也可以防止出现主进程卡的情况
上一篇:今日异常(7.6):Mybatis错误:There is no getter for property named 'xxx' in 'class java.lang.S


下一篇:合肥市MedAccred _AC8121电子电缆和线束组件的审核标准 (50)