//METODO 1:
//Using the class QTest
QTest::qSleep(100); // it block the event processing
QTest::qWait(100); // it does not block the event processing
//METODO 2:
//Using the classes QWaitCondition and QMutex
QWaitCondition waitCondition;
QMutex mutex;
waitCondition.wait(&mutex, 100);
//METODO 3:
//Or derive our class from QThread
class Thread : public QThread
{
public:
static void msleep(int ms)
{
QThread::msleep(ms);
}
};
Thread::msleep(100);