What sense would it make? If you already have a surface to draw on which context you want to adopt, what would creating a new widget (hence another surface to draw on) do? Where would the rendering occur?
Again, in my opinion this doesn't make sense.I start with a new QOpenGLWidget, then get its context, and call context's setNativeHandle, but it occur an error.
Am I right that you would like your alien game engine render within Qt's window? In that case it is the game engine that should adopt Qt's context, not the other way round. You could probably use a QOpenGLFramebufferObject and bind it with the adopted context, then make your game engine render itself to the FBO and then use that FBO as a texture in Qt.
Bookmarks