Details
-
Bug
-
Resolution: Unresolved
-
P1: Critical
-
None
-
6.7.2, 6.8.0
-
None
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(); }