The example that you suggested worked fine on the IMX8. We were able to visualize both the windows on IMX8 as the window is a QWindow. But in our case, we are using a class which is inherited from QQuickFramebufferObject ( QQuickItem-derived class ) which needs to be registered to QML and used like any other standard Quick element. So it looks like the window on top of which 3D has to be rendered should be a QML window. The context was always set but the rendering on the desired screen is not happening on IMX8 unlike on Desktop. My code looks something like this:

QML:

Window {
width: 640
height: 480
visible: true
//...
//...

Window {
height: 400
width: 400
visible: true

//Custom 3D class which is registered to QML
3DTest {

}
}
}


Backend : CustomClass : public QQuickFramebufferObject //class which renders 3D

CustomClass :: redraw () {

QOpenGLContext *glContext = QOpenGLContext::currentContext () ; //Only place where the context is set
if ( glContext ) {

// calling necessary openGL functions for redrawing the 3D

}
}

Am I missing something here?