[Qt-interest] Delay of code execution

Peter qt at bienert-rh.de
Fri Apr 16 13:00:03 CEST 2010


Hi,Matthias,
you wrote, that "delay" does not work inside a thread. But if you are 
inside a thread (derived from QThread), you can use the "msleep" member 
of QThread directly. I often use a QThread derived class for background 
tasks and msleep works fine (if you need that)...
Regards,
Peter

Am 14.04.2010 11:37, schrieb Matthias Pospiech:
> K. Frank schrieb:
>> Hi Matthias -
>>
>> Hmm...
>>
>> I tried your method (for educational purposes only), and I found that it
>> worked both in my main gui thread, and in a separate thread I created.
> A can confirm that it really works. I had been fooling myself by looking
> on a different device which
> was much slower and was still processing the macro events while the
> delays had all been timed out already.
>
> Matthias



More information about the Qt-interest-old mailing list