Le 03/08/2015 00:53, Guillaume Munch a écrit :
Le 02/08/2015 02:38, Richard Heck a écrit :
On 08/01/2015 04:37 PM, Pavel Sanda wrote:
Guillaume Munch wrote:
+    const int long_delay = 400;
+    const int short_delay = 40;
So we will regenerate paragraph each 40ms no matter whether user
typed/moved with the cursor
or this gets triggered only after user action?

I believe the latter.

Richard



It is the former. I did not change this particular behaviour of the code.

More precisely, currently it is generated with each action/movement
while with the patch it is only after 40ms at rest. The 40ms are meant
to be longer than the keyboard repetition. This is to avoid generating
the paragraph repeatedly when holding the arrow keys, while having no
apparent delay in the feedback when typing.

(After some more tests I find that 60ms would be better. Any opinion on
the appropriate delay?)



I have interpreted the question as to whether there is a distinction between movements and other actions, since the latter often don't require a regeneration if it's the same paragraph. But I might have misinterpreted. Of course, the generation is only triggered after the user acts or moves, since the QTimer is non-repeating (setSingleShot).

It might be worth mentioning for people unfamiliar with QTimers that start() resets the timer if it is already running, which is why it only triggers at rest.

Reply via email to