Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
4.6.2, 4.7.1
-
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; /* ... */