Qt每隔0.5秒或一秒就监听函数的返回值:
1.你的类继承自QObject,并实现virtual void timerEvent(QTimerEvent * event),然后启动的时候调用startTimer(500), 在你timerEvent函数里判断你的那个返回值
2.创建一个QTimer对象
QTimer *timer = new QTimer(this);
connect(timer, SIGNAL(timeout()), this, SLOT(update()));
timer->start(500);
在udpate函数里做判断