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

QOffscreenSurface not created in GUI thread...

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.9.3
    • GUI: OpenGL
    • None
    • Windows 10, Mac OS X 10.13.3

    Description

      I create an offscreen surface in the constructor of my widget and store its pointer in a global variable with the following code:

      LAUManOWarGLContext::offScreenSurface = new QOffscreenSurface(QGuiApplication::screens().first()); LAUManOWarGLContext::offScreenSurface->create(); if (LAUManOWarGLContext::offScreenSurface->isValid()) { 

      I then create a thread, inside of which I create a QOpenGLContext with the following code:

      // CREATE A GLCONTEXT TO DO THE PROCESSING LAUManOWarGLContext *context = new LAUManOWarGLContext(lookUpTable); context->setFormat(LAUManOWarGLContext::offScreenSurface->format()); context->setSurface(LAUManOWarGLContext::offScreenSurface); context->create(); context->initialize(); 

      but sadly the code crashes on Windows 10 saying that the QOffscreenSurface was not created in the GUI thread.

      I've searched all the documentation, and everything says that the QOffscreenSurface must be created in the main GUI thread (and it is), but nothing that says that context must be created in the main thread. So what gives?

       

       

       

       

      Attachments

        1. main.cpp
          0.6 kB
          Daniel Lau
        2. LAUOpenGLContextTestWidget.pro
          1.0 kB
          Daniel Lau
        3. lauopenglcontexttestwidget.h
          2 kB
          Daniel Lau
        4. lauopenglcontexttestwidget.cpp
          4 kB
          Daniel Lau
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            drhalftone Daniel Lau
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes