qt-interest@trolltech.com
[Top] [All Lists]

Re: OT - Need advice on pausing my program

Subject: Re: OT - Need advice on pausing my program
From: Chris Comparini
Date: Wed, 23 Nov 2005 10:41:10 -0800
On Wednesday 23 November 2005 10:28, Michael Sullivan wrote:
> In my project I have a QCanvasView with several sprites on it.  Four of
> the sprites will need to be moving during the run of the program.  I'm
> translating this project from Java.  In the Java version I would move
> the sprite and then issue Thread.sleep(200) (make the program sleep for
> 200 milliseconds so that the user could  see that the sprite had moved)
> and then move the sprite again and reissue the Thread.sleep(200).  I was
> considering using the sleep function included in unistd.h, but I thought
> I'd ask here to see if there was a Qt solution that might work better...

Maybe try http://doc.trolltech.com/4.1/qthread.html#msleep  ?

I don't know what would happen, but I'd be suspicious of using the unistd.h
sleep method with threads.  The QThread::msleep() method should be safe.

  -Chris

<Prev in Thread] Current Thread [Next in Thread>