Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
5.10.1
-
None
Description
The QPainter which will be painting to QOpenGLWidget doesn't set active texture to texture 0.
// Following snippet demonstrates the problem - code is in class derived from QOpenGLWidget - method paintGL(): ... // Assuming active texture set to other than texture 0 // e.g. context()->functions()->glActiveTexture(GL_TEXTURE0 + 1); QPainter painter; painter.begin(this); // context()->functions()->glActiveTexture(GL_TEXTURE0); // Uncomment so that code works painter.drawImage(0, 0, m_sceneBitmap); painter.end(); ...
The problem is painter.begin() assumes that active texture is texture 0, which may not be true. The result is black (or possibly some other) image instead of image which is requested to be drawn.
Found by inserting painter.beginNativePainting(); painter.endNativePainting(); empty brackets and examining what all it does.
P.s.: Don't have time to create full reproducer. Examine your code.