Yes, according to the docs, processEvents() processes all pending events before returning - all this work is done in the same thread. So, if function A() calls processEvents(), and one of the event handlers (perhaps B()) then calls A() again, there might be some recursion. I don't think it would be infinite recursion; the event being processed must be removed from the list of pending events before getting processed, and it looks like Qt follows this at least in Windows (in qeventdispatcher_win.cpp):
msg = d->queuedUserInputEvents.takeFirst();

The funny result is that events might be processed in reverse order as it finishes its recursion; but the processing should go on as the pending event list is whittled away.