Although QOpenGLWindow and QOpenGLWidget are nice Qt5.4 convenience classes, you can still use a vanilla QWindow to render OpenGL. It is available starting with Qt5.0.
It's a little more code to start but after that it's straightforward. The OpenGL Window Example shows how to use it.
Still, updating to more recent Qt version is a preferred thing to do. There's no reason to teach people things that are outdated from the get go. The unnecessary boilerplate code will obscure the topic.