Hi
Using the code from the other post
#include <QApplication>
#include <QOpenGLWidget>
#include <QOpenGLFunctions>
#include <QPainter>
class MyOpenGLWidget : public QOpenGLWidget
{
public:
MyOpenGLWidget() {}
void initializeGL()
{
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
f->glClearColor(1.f, 1.f, 1.f, 1.f);
}
void resizeGL(int w, int h)
{
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
f->glViewport(0, 0, w, h);
}
void paintGL()
{
QOpenGLFunctions *f = QOpenGLContext::currentContext()->functions();
f->glClear(GL_COLOR_BUFFER_BIT);
QPainter painter(this);
painter.setPen(Qt::black);
painter.setFont(QFont("Arial", 56));
painter.drawText(0, 0, width(), height(), Qt::AlignCenter, "Hello World!");
painter.end();
}
};
int main(int argc, char **argv)
{
QApplication app(argc, argv);
MyOpenGLWidget wnd;
wnd.resize(400, 300);
wnd.show();
return app.exec();
}
[image: CPWn5y.png]
Tried on win 10, win 7 and linux and had no text corruption.
Where are you seeing this ?