Quote Originally Posted by artoonie View Post
I would guess that one of two things is happening:
- The monitor refresh rate of 60Hz is not synchronized with the applications refresh, or
- The widget does not actually update every 6ms
Both of these things are happening.

QTimer can be set in whole milliseconds only. Approximating a 1/60 seconds rate with 16 msecs will lead a whole frame difference in time after 24 or 25 frames even if the timer events were perfectly spaced. A 17 msec approximation will extend the sync out to around 48-50 frames. QTimer events are processed when the program returns to the event loop after the time has expired. Depending on what else the program is doing, like rendering your gradient, this might be a significant delay. The combination of the two will lead to a mismatch that is variable with activity.

MythTV can use timers to maintain video refresh sync, but I believe it also has extensive frame counting over relatively long periods to determine the average frame rate and drops/duplicates frames to realign things periodically. The preferred method in MythTV is to use the OpenGL vsync. I don't know how this can be accessed.