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

[REG 6.3.2 -> 6.4] Native QOpenGLWidget in QMainWindow breaks menu bar

    XMLWordPrintable

Details

    • 8c0b657c9 (dev), d397fee62 (6.5)

    Description

      Code

      #include <QApplication>
      #include <QMainWindow>
      #include <QOpenGLWidget>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          app.setAttribute(Qt::AA_NativeWindows);
      
          QMainWindow w;
          w.setCentralWidget(new QOpenGLWidget);
          w.menuBar()->addAction("Hello");
          w.show();
      
          return app.exec();
      }
      

       

      Outcomes
      The menu bar text does not appear. The debug output shows the following messages at startup, as well as every time you move your mouse cursor over the menu bar where the text is meant to be:

      QOpenGLContext::makeCurrent() called with non-opengl surface 0x19699b03180
      QRhiGles2: Failed to make context current. Expect bad things to happen.
      

       

      Notes

      • The problem doesn't occur if QMenuBar::addAction() is not called
      • The problem doesn't occur if Qt::AA_NativeWindows is removed

      Attachments

        Issue Links

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

          Activity

            People

              lagocs Laszlo Agocs
              skoh-qt Sze Howe Koh
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes