I meant this loop: while app.hasPendingEvents():