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

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.12.4
    • Fix Version/s: 5.12.7, 5.13.2
    • Component/s: GUI: OpenGL
    • Labels:
      None
    • Environment:
      Win10/osx mojave/Ubuntu 18.04

      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

            Assignee:
            lagocs Laszlo Agocs
            Reporter:
            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