2013-04-11 197 views
0

在Qt的特定时间有没有简单的方法来调用事件?还是我需要实现一些循环来检查时间?Qt在特定时间运行?

如何做到这一点的任何建议,将不胜感激,即使它不使用Qt

+1

嗯..我有一些想法关于C#..在这里,这可以帮助你了解.. http://stackoverflow.com/questions/307798/how-can -i-raise-an-event-every-hour-or-specific-time-interval-each-hour-in-ne – 2013-04-11 05:02:02

+0

http://stackoverflow.com/questions/5392124/scheduling-task-in-using的副本-c-on-linux-and-windows-machine – 2013-04-11 05:14:06

+0

谢谢Wouter,我做了一个搜索就是找不到正确的措辞,我想你可以说。它给了我我正在寻找的答案。 – 2013-04-11 05:17:47

回答

2

QTimer会有所帮助。

事情是这样的:

QTImer *timer = new QTimer(this); 
    timer->setInterval(1000); 
    connect(timer, SIGNAL(timeout()), this, SLOT(timerTimeout()));