QTimer también se puede usar para solicitar que una función se ejecute tan pronto como el bucle de eventos haya procesado todos los demás eventos pendientes. Para ello, utiliza un intervalo de 0 ms.
// option 1: Set the interval to 0 explicitly.
QTimer *timer = new QTimer;
timer->setInterval( 0 );
timer->start();
// option 2: Passing 0 with the start call will set the interval as well.
QTimer *timer = new QTimer;
timer->start( 0 );
// option 3: use QTimer::singleShot with interval 0
QTimer::singleShot(0, [](){
// do something
});