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

QOpenGLWidget in an undocked QDockWidget fails to use global shared context when Qt::AA_ShareOpenGLContexts is specified

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.12.7, 5.13.2
    • 5.12.4
    • GUI: OpenGL
    • None
    • Win10/osx mojave/Ubuntu 18.04
    • All
    • ce2fc51914f809369d5096e7a0621229dd9eaef9 (qt/qtbase/5.13) 28b138cbc21c4bed7b18b70bb98a690d000ad2f9 (qt/qtbase/5.12)

    Description

      I use the Qt::AA_ShareOpenGLContexts application flags to enable context sharing accross top level window. I've checked that the qt_gl_global_share_context() is vaild.

      When i create a QOpenGlWidget as a child of a floating QDockWidget, it fails to create its openGL context shared with the qt_gl_global_share_context().

      It seems to be an issue with the source code of the QOpenGLWidgetPrivate::initialize(). This method is supposed to init the Widget context from the shareContext of its top level window. But in my case, there is not top level window and thus the call to get(tlw)->shareContext(); returns null. This is what we expect, but in my case since i have the Qt::AA_ShareOpenGLContexts flag set, i would expect that it fallbacks on the qt_gl_global_share_context() but it doesn't. 

      The QQuickWidgetPrivate::createContext() method is doing something similar to QOpenGLWidgetPrivate::initialize() but it takes into account the qt_gl_global_share_context(). By replacing the code related to the shareContext of QOpenGLWidgetPrivate::initialize() by the one in QQuickWidgetPrivate::createContext(), it works as expected.

       

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            achassany Alexandre CHASSANY
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes