PDA

View Full Version : QTimer delay



dima
1st October 2009, 08:48
Hi,
I have QGLWidget something like QDial .
I need to calculate widget rotation approximately 5 times in second and I use QTimer for that.
The problem happen when I start rotate my widget FAST,QTimer timeout suspend until speed of mouse moving is dropping.

Any suggestion for alternative solution.

DrDonut
2nd October 2009, 09:28
If you havn't already, you might want to take a look at the QBasicTimer (http://doc.trolltech.com/4.3/qbasictimer.html) class.

I don't know if it has the same problem, but it might be worth giving it a shot.

Good luck
DrDonut

wysota
2nd October 2009, 12:43
This is caused by the way Windows processes events when mouse button is pressed (meaning it doesn't process some of them). Honestly I don't know if there is a workaround for this.

daren
2nd October 2009, 14:31
The only code that will be called are handlers for mouse move events. Restructure your code to periodically do required activity from the mouse move event handler. If you on windows you may try to play games with message queue, but that may be messy