Try modifying the code to make the cube animated. To do that, have the scene inherit QObject, add an angle property of the float type to it (remember about the Q_OBJECT macro). Then, modify one of the glRotatef() lines to use the angle value instead of a constant value. Put the following code in main(), right before calling app.exec():
QPropertyAnimation animation(&scene, "angle");animation.setStartValue(0);animation.setEndValue(359);animation.setDuration(5000);animation.setLoopCount(-1);animation.start();
Remember to put a call to window()->update() in the setter for the angle property so that the scene is redrawn.