A few years ago I was attempting to use shadow maps in Qt/OpenGL but was simply unable to use QOpenGLFrameBufferObject as a shadow-buffer. I had even posted a question about it on stack-overflow here. It turns out, you cannot use QOpenGLFrameBufferObject for creating shadow buffers. So, I had to resort to native OpenGL calls. Recently someone reached to me on LinkedIn asking me if I could share the code.
When the code at this repository is compiled and executed, we can see a window with two bikes, with their shadows on the ground and on each other.
You can press any key to rotate the whole scene and watch the shadows move.