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

QGLContext::QGLContext ( const QGLFormat & format ) doesn't initialize paintdevice

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P2: Important
    • 5.13.2
    • 4.6.2, 4.7.1
    • Documentation, GUI: OpenGL
    • None
    • MeeGo 1.1.90, Ubuntu 10.04

    Description

      The docs for QGLContext::QGLContext ( const QGLFormat & format ) say that after I call QGLContext::create() then the context will be ready to use. However, create() bails because d->paintDevice is null. There is no way to set d->paintDevice to a valid pointer through the public API, either.

      #include <QtCore/QtCore>
      #include <QtGui/QtGui>
      #include <QtOpenGL/QtOpenGL>
      #include <cassert>
      
      int main(int argc, char* argv[])
      {
          QApplication  app(argc, argv);
          QGLContext *cx = 0;
          bool rv;
      
          cx = new QGLContext(QGLFormat(QGL::SampleBuffers));
          assert(cx);
          rv = cx->create();
          assert(rv);
      
          return 0;
      }
      

      $ g++ -o main `pkg-config --cflags --libs QtCore` `pkg-config --cflags --libs QtGui` `pkg-config --cflags --libs QtOpenGL` main.cpp
      $ ../main
      main: main.cpp:16: int main(int, char**): Assertion `rv' failed.
      Aborted
      $

      From qgl.cpp (4.7.1):

      bool QGLContext::create(const QGLContext* shareContext)
      {
          Q_D(QGLContext);
          if (!d->paintDevice)
              return false;
      /* ... */
      

      Attachments

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

        Activity

          People

            leenam Leena Miettinen
            gabrbedd Gabriel M. Beddingfield
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes