Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-130601

[Regr: 5->6] QOpenGLWidget surface failed to initialize correctly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 6.7.2, 6.8.0
    • QPA: Wayland
    • None
    • Linux/Wayland

    Description

      In the Qt6 Wayland environment, if a QOpenGLWidget instance is added using QStackedWidget and the initial index is not set to it, an error will be reported after startup: qt.qpa.wayland: eglSwapBuffers failed with 0x300d, surface: 0x0, and the current program will be displayed in the taskbar but there will be no window. I tried versions 5.15.13, 6.7.2, and 6.8.0, which are normal in Qt5, and both Qt6 versions will have this error

      #include <QApplication>
      #include <QStackedWidget>
      #include <QOpenGLWidget>
      
      int main(int argc, char *argv[]) {
          QApplication a(argc, argv);
          QStackedWidget w;
          w.resize(800, 600);
          auto widget = new QWidget(&w);
          auto openGLWidget1 = new QOpenGLWidget(&w);
          auto openGLWidget2 = new QOpenGLWidget(&w);
          w.addWidget(widget);
          w.addWidget(openGLWidget1);
          w.addWidget(openGLWidget2);
          // w.setCurrentIndex(0); //if set index non-QOpenGLWidget run error
          w.setCurrentIndex(1); //set any one QOpenGLWidget normal display
          w.show();
          return QApplication::exec();
      }
       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qt.team.graphics.and.multimedia Qt Graphics Team
            yfan99 yl hwr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes