With this lag, I really suspect a no-synchronization between the call of query_frame and the call of paintEvent into this.

Could you help me to force the synchronization in order to, when I call paintEvent with repaint(), have the image displayed once and after, have
the next call of query_frame by QTimer ?

Thanks !