intdelayTime=3;
QElapsedTimer timer;
timer.start();
while(timer.elapsed()<(delayTime*1000))
{
app.processEvents();
}