Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Error displaying QOpenGLWidget on newer version
Forum Updated to NodeBB v4.3 + New Features

Error displaying QOpenGLWidget on newer version

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 2 Posters 194 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheEnigmist
    wrote 30 days ago last edited by
    #1

    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?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote 29 days ago last edited by
      #2

      Hi,

      I would go with a regression but first: 6.10 ? It's not released yet. Can you check with 6.9.0 ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • T Offline
        T Offline
        TheEnigmist
        wrote 28 days ago last edited by
        #3

        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.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote 28 days ago last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          T 1 Reply Last reply 28 days ago
          0
          • S SGaist
            28 days ago

            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.

            T Offline
            T Offline
            TheEnigmist
            wrote 28 days ago last edited by
            #5

            @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.

            Created

            1 Reply Last reply
            0

            5/5

            14 May 2025, 22:11

            • Login

            • Login or register to search.
            5 out of 5
            • First post
              5/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved