Change QCocoaEventDispatcher timer handling to use QTimerInfoList
authorBradley T. Hughes <bradley.hughes@nokia.com>
Thu, 5 Jan 2012 13:29:15 +0000 (14:29 +0100)
committerQt by Nokia <qt-info@nokia.com>
Mon, 9 Jan 2012 08:45:07 +0000 (09:45 +0100)
commitd23322bf1cdb28a5ad3163a789bb94287b0dfc9d
tree1ba2d20ed532b4f2debc63536d063189a54695b8
parentc7755d33dbf4b26b208487d4336fca7734bbedcf
Change QCocoaEventDispatcher timer handling to use QTimerInfoList

This gives us support for the various Qt::TimerTypes.

We only use one CFRunLoopTimer to drive all of the Qt timers. We update
the time-to-fire for this timer as we add/remove/fire Qt timers. The
documentation for the CFRunLoopTimerSetNextFireDate() function says that
this is a valid use case, and is more performant than constantly adding
and removing CFRunLoopTimers. The documentation recommends using a large
interval for this use case (the docs say "several decades", but we use 1
year).

Change-Id: Ie7fd7a845f4254699a5b6a5720e7626f2c5e787f
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@nokia.com>
src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm