[Qt-interest] Delay of code execution

Andre Somers andre at familiesomers.nl
Tue Apr 13 17:28:33 CEST 2010


On 13-4-2010 17:09, Matthias Pospiech wrote:
> Did I understand something wrong? Which is the recommanded solution?
> I know that in a thread I could as well use msleep, but I would like to
> have a solution which can be used anywhere
> in the programm and also outside of QThread classes.
>
>    

Perhaps you should talk about the issue you want to resolve by using a 
delay, instead of the question on how to create a delay. Creating delays 
is considered Bad (TM). They tend to use lots of resources for nothing 
(like your first loop), and hinder the user experience in that they 
often block the UI or do similar silly things.
So, the recommended solution is: don't use delays.

André




More information about the Qt-interest-old mailing list