3D Widget after show() has (0,0)-sized window until fully displayed

In order to make a custom camera reset in a 3D widget (qMRMLThreeDWidget), I need to access the vtkRenderWindow size after the call for the widget to show().
However, I noticed that the window size was (0,0) if performed shortly after the show(), likely due to the window not being fully rendered yet.
I tried and failed with the following attempts:

size = widget.threeDView().renderWindow().GetSize() # sill is (0,0)


while not widget.visible:
size = widget.threeDView().renderWindow().GetSize() # sill is (0,0)

Is there a way to get the size only once the 3D widget is done rendering ? Perhaps with through a connect to a signal or an observer for an event ?
Thanks for any help

You could try either slicer.app.processEvents() or use a QTimer.singleShot so the event loop has had a chance to run.

slicer.app.processEvents() worked, thanks !