[Qt-interest] MouseMove response time resolution

Christian Gagneraud cgagneraud at techworks.ie
Mon Nov 29 22:58:30 CET 2010


On 11/29/2010 08:59 PM, "Alexander Carôt" wrote:
> Hi all,
>
> I just checked the mouseMoveEvent handler in terms of response time
> resolution. In that context it seems that it does not notice
> events, which occur within a time frame of approx. 15 ms.
>
> What I did: I have a thread, which executes each 1.3 ms. Into this

Are you sure your thread is really executed every 1.3ms?
This is almost 1KHz, I doubt that your OS can schedule your periodic 
thread at that frequency, unless you're using special real-time stuff...


> thread I plot the mouseX and mouseY coordinates (updated in the
> mouseMoveEvent according to event->globalX and event->globalY)
> while dragging the mouse quickly from a to b and so forth. With
> each execution I hoped to see the updated x and y coordinates for
> the respecive mouse position. However, it takes 12 circles to see a
> coordinate update, which makes me believe that the corresponding
> mouseMoveEvent is not updating in the desired time response
> resolution.

Why you don't simply print a timestamp with the mouse position in your 
mouseMouveEvent() handler? If you're afraid that it will add extra 
delay to print the messages, then you can communicate with your 
display thread using QWaitCondition and a FIFO buffer. This way you 
won't have to use the polling method and won't be annoyed by your OS 
scheduling resolution.

I'm interesting to see your readings.

Regards,
Chris

>
> In this correct or is there a way how to improve the time
> resolution ?
>
> Thanks in advance and best regards
>
> -- A l e x


-- 
Christian Gagneraud,
Electronics and software engineer

TechWorks Marine Ltd
4a, Park Lane
Dun Laoghaire, Co Dublin
Ireland

Tel: + 353 1 2365990
Fax: + 353 1 2365992
Web: www.techworks.ie







More information about the Qt-interest-old mailing list