My bad, was too quick writing QObject instead of QWidget.

True, Qt is drawing the window, but in response to an event.

There are two ways that event can be generated, by Qt, in which case paintEvent() is generated, or by the OS, in which case WM_PAINT generated by OS is translated by Qt to paintEvent().
In first case Qt knows why the paint event was generated, in other case it just does what the OS told it to do.

Look at it this way, your son (Qt) may brush his teeth in the evening before going to bed, but it may also have to brush the teeth straight after dinner because you (OS) have told him to.
(I'm very bad at analogies! Sorry!)

When OS moves some window using MoveWindow() it also tels that window to repaint itself via UpdateWindow() (and WM_PAINT in result).
You have to remember that Qt app sits on top of OS and OS can do everything to the app.

Read the WinApi doc for MoveWindow() and UpdateWindow(). That should clear things up.

I hope my explenation makes now some more sense.