Error displaying QOpenGLWidget on newer version
-
wrote 6 days ago last edited by
I have an overlay—a transparent, fullscreen window—implemented with QOpenGLWidget in Qt 6.8.0, and it works perfectly. However, after upgrading to Qt 6.10, it no longer functions properly: the background is rendered completely black instead of transparent.
Overlay::Overlay(QWidget* parent): QOpenGLWidget(parent) { setWindowFlags(Qt::FramelessWindowHint); setWindowFlag(Qt::WindowTransparentForInput); setAttribute(Qt::WA_TransparentForMouseEvents); setAttribute(Qt::WA_TranslucentBackground); setAttribute(Qt::WA_NoSystemBackground, false); setWindowFlag(Qt::WindowStaysOnTopHint); renderScreen = QGuiApplication::primaryScreen(); QRect screenGeometry = renderScreen->geometry(); move(screenGeometry.topLeft()); setFixedSize(screenGeometry.width() - 1, screenGeometry.height() - 1); this->show(); } void Overlay::initializeGL() { QOpenGLFunctions* f = context()->functions(); f->glClearColor(0.0f, 0.0f, 0.0f, 0.0f); } void Overlay::resizeGL(int w, int h) { QOpenGLFunctions* f = context()->functions(); f->glViewport(0, 0, w, h); } void Overlay::paintGL() { QOpenGLFunctions* f = context()->functions(); f->glClearColor(0.0f, 0.0f, 0.0f, 0.0f); f->glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); QPainter painter; painter.begin(this); ... painter.end(); }
Has anything changed in Qt since version 6.8.0 that I need to configure to fix this issue?
-
Hi,
I would go with a regression but first: 6.10 ? It's not released yet. Can you check with 6.9.0 ?
-
wrote 4 days ago last edited by
I ran some tests with different versions; here are the results:
- 6.8.0: works as expected
- 6.8.3: works as expected
- 6.9.0: background is completely black; the alpha value of 0.0f is ignored
- 6.10.0: background is completely black; the alpha value of 0.0f is ignored
It appears that something went wrong starting with version 6.9.0.
-
You should check the bug report system to see if there something about your issue already and if not please open a new ticket providing a minimal compilable reproducer.
-
You should check the bug report system to see if there something about your issue already and if not please open a new ticket providing a minimal compilable reproducer.
wrote 4 days ago last edited by@SGaist said in Error displaying QOpenGLWidget on newer version:
You should check the bug report system to see if there something about your issue already and if not please open a new ticket providing a minimal compilable reproducer.
1/5