I'm just learning OpenGL programming now, the tutorials in the guide use glut but I'm trying to do them with QGLWidget instead.

Does anyone know if there is an equivalent for glutIdleFunc() in QGLWidget? It sets a function that is called whenever the program is idle, used for animation in the example.

I was thinking I could set it up a signal and slot with a timer, but that could result in either gaps between the animations if the timer is too high, or weird behaviour if the timer is too low.