[Qt-interest] Delay of code execution

Julien Cugnière julien.cugniere at gmail.com
Tue Apr 13 18:10:15 CEST 2010


2010/4/13 Matthias Pospiech <matthias.pospiech at gmx.de>
> class SleeperThread : public QThread
> {
> public:
>    static void msleep(unsigned long msecs)
>    {
>        QThread::msleep(msecs);
>    }
> };
>
> inline void delay(long ms)
> {
>       SleeperThread::msleep(ms);
> }
>
> If I however use the latter approach inside a thread I see that the
> function delay(1000) returns immediately.

Hmm, that's strange : it should definitely work. I've used the same
exact hack when I needed to pause from inside C callbacks which
couldn't be integrated with Qt's event loop.

What platform are you developing on ?

--
Julien Cugnière




More information about the Qt-interest-old mailing list