[Qt-interest] Controlling when timers run
KC Jones
kc at asperasoft.com
Fri Jan 15 03:04:29 CET 2010
Would QCoreApplication::hasPendingEvents() be useful here?
Or will it always be true when called from a QTimer signal?
On Thu, Jan 14, 2010 at 4:55 PM, Glenn Hughes <ghughes02138 at gmail.com> wrote:
> 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
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list