开发者

Insert Event in Qt's event loop without using QTimers

开发者 https://www.devze.com 2023-03-03 20:03 出处:网络
I am looking for a way to insert a call to my function or a slot with every looping of the Qt\'s event loop. I know there exists a solution using QTimers which is prescribed by Qt but they also say it

I am looking for a way to insert a call to my function or a slot with every looping of the Qt's event loop. I know there exists a solution using QTimers which is prescribed by Qt but they also say it is possible by calling processEvents(). Does that mean that I don't call exec at all and do the following?

while(true)
{
// My processing code
//  blah blah
qApp.processEvents();
}

I开发者_StackOverflow believe this is not what they meant. Does anyone have more idea on how to do this using the processEvents() approach?

This question is similar to Executing slot on every application's event loop iteration but I am looking for something completely without timers.

Any references or links are very much appreciated. Best,

CV

0

精彩评论

暂无评论...
验证码 换一张
取 消