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

Qt3DWindow constructor should not call QSurfaceFormat::setDefaultFormat()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P1: Critical
    • None
    • 5.9.0, 5.9.1, 5.9
    • Qt3D
    • None
    • macOS

    Description

      The constructor for Qt3DWindow creates a QSurfaceFormat and calls QSurfaceFormat::setDefaultFormat.

      This is a problem because:

      0) it makes not possible to use Qt3D alongside with QtWebEngine
      1) this may prevent the use of a global shared context as QSurfaceFormat::setDefaultFormat has to be called before creation of the QApplication
      2) there's no way to change the details of the QSurfaceFormat that is hardcoded in the constructor
      3) calling QSurfaceFormat::setDefaultFormat more than once gives this warning:

      Warning: Setting a new default format with a different version or profile after the global shared context is created may cause issues with context sharing. (qsurfaceformat.cpp:770, static void QSurfaceFormat::setDefaultFormat(const QSurfaceFormat &))

      Possible solutions (each with their own positives and negatives):

      1) remove it completely and leave it to the application to decide what to use
      2) provide a public method Qt3DWindow::initDefaultSurface() as a convenience that does what's currently in the constructor
      3) only set it if it hasn't already been set (doesn't really solve all the problems though)
      4) (something else I haven't thought of yet)

      This may be related to QTBUG-59145 and ---QTBUG-53880---

      Attachments

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

        Activity

          People

            lemire_p Paul Lemire
            asm Andy M
            Votes:
            6 Vote for this issue
            Watchers:
            15 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes