[Qt-interest] Controlling when timers run
Glenn Hughes
ghughes02138 at gmail.com
Fri Jan 15 01:55:43 CET 2010
Hmmm... now looking at the source I'm not sure I'm out of the woods.
What I really need is a way to find out "how many levels deep in exec
nesting" I am, or a notification when a new exec method is entered. It
looks like I could do this if I wanted to modify the Qt source, but
not without. There's an obsolete "QCoreApplication::loopLevel"...
wonder what took its place!?
The reason is, EventLoop::processEvents waits for new events to be
available, so its inside of this call that all timers will run. My
timers need to be running at this point. What I want to do is to pause
all my timers when the second exec is entered, but there are no
notifications sent out when exec is entered that I can see.
The only other thing I could do is to not pass WaitForMoreEvents...
and do my background processing without the app's exec method. This is
generally considered bad form, as it can needlessly chew CPU cycles if
no timers actually need time.
G
More information about the Qt-interest-old
mailing list