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

QGLPixelBuffer: This relies on a QGLWidget being available, if there isn't one it creates one

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.4.0
    • Documentation
    • None

    Description

      QGLPixelBuffer: This relies on a QGLWidget being available, if there isn't one it creates one, therefore in multithreaded apps, a QGLWidget should be created in the main thread before the thread using the pixel buffer is started to prevent an issue. Also, makeCurrent() needs to be called on that QGLWidget before the QGLPixelBuffer is created in the other thread.

      Example (which worked for me at least)

      #include <QtOpenGL>

      class MyThread : public QThread
      {
      public:
      MyThread(QGLWidget *gl, QObject *parent = 0) : QThread(parent), glx(gl) {}
      protected:
      void run()

      { glx->makeCurrent(); QGLPixelBuffer::hasOpenGLPbuffers(); }

      private:
      QGLWidget *glx;
      };

      int main(int argc, char **argv)
      {
      QApplication a(argc, argv);
      QGLWidget gl;
      MyThread t(&gl);
      t.start();
      return a.exec();
      }

      Attachments

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

        Activity

          People

            jerome.pasion Jerome Pasion
            anshaw Andy Shaw (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes