Normally for animations, you let Qt figure out the appropriate timing. Is there a particular reason to run it so fast? If you use QPropertyAnimation, you can get some pretty slick results, with smooth animations. The EasingCurve
s also can give you some great effects.
http://qt.apidoc.info/4.8.5/animation-animatedtiles.html
EDIT: Also calling update
60x a second doesn't necessarily redraw it 60 times a second; instead you are putting requests-for-a-repaint on the event loop 60x a second. Depending on how much time Qt gets and the refresh rate of the graphics card and what not, if the main GUI event loop of your program may only get around to redrawing your graphic 20-35x a second, the multiple update
calls get ignored. If you demand to be drawn 60x a second you would use repaint()
. But in most cases you should call update
.
http://qt-project.org/doc/qt-4.8/qwidget.html#update
Also you should try to cache as much of the calculations as you can if it is slowing your computer down so much. Hope that helps.