Referring to the test application in attachment. It creates an QOpenGlContext in the OGLShareWindow class, makes it current and then initializes OpenGL and a simple shader program.
This context is converted to an QGLContext. This is used for creating a QGLWidget which is used as base for creating TriangleWidget that shows an OpenGL rendered triangle.
On execution it always displays the error "QGLShaderProgram::bind: program is not valid in the current context".
Note that everything works when subclassing from QWindow, as is the case with the TriangleWindow instance. The problem only occurs when converting/sharing the context to be used with QGLWidget for the TriangleWidget instance.
This reproduces both on PC and iMac. The PC has an Nvida Quadro K600, Nvidia driver 332.76 and Windows 7. The iMac has an AMD Radeon HD 6770M and runs OS X 10.7.5. Both configurations have the same problem. Also reproduces with Ubuntu 12.04 (ATI Radeon HD 6670/7670)
|For Gerrit Dashboard: QTBUG-37893|
|82383,1||Avoid recreating the underlying context in QGLContext wrappers||stable||qt/qtbase||Status: MERGED||+2||0|