Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Squares instead of letters when using QPainter::renderText on a texture placed in QOpenGLWidget



  • There is a QOpenGLWidget on which a texture is placed using glTexImage2D. I'm trying to draw text on this texture using QPainter.DrawText, but it doesn't work. I get squares of all letters. But if you increase the font to 44, the text is displayed correctly. Also, if you remove the texture mapping via glTexImage2D, the text is displayed correctly. I tried a lot of things, nothing helped… Qt version 6.1.2



  • @harlamer Without a minimal compilable example that demonstrates the problem there's not much we can do. We do not know what platform, what font, what texture and texture setup, how the painter has been set up, what "displayed correctly" means, etc.