I haven't heard about issues happening just because of long execution time. Consider checking the following scenarios:
- Check system logs for possible graphic driver failures. OpenGL applications are not able to restore after system restarts GPU drivers.
- Try locking / unlocking workstation with running application to see if it has any effect.
- Try putting system into sleep / hibernation explicitly (if this is what might happened with your workstation at night).
- Try collecting application logs with timestamps to see when first failure actually happened. Probably RAM / GPU memory statistics might be useful to detect GPU memory leaks.
- If your system is a notebook with hybrid graphics, then try disabling auxiliary GPU to see if it solves the issue (maybe driver forced every saving mode somehow?).
If that is not the case, then maybe Qt does something wrong and tricky (recreated window for some reason? or recreated OpenGL context?). Try logging Qt events / check its documentation if QOpenGLWidget has such exceptional cases that should be treated somehow.