PDA

View Full Version : QGLWidget::setContext: Context must refer to this widget



freddy
13th November 2008, 17:00
Hi gang,

I am trying to share QGLContext amongst different QGLWidgets and am getting an error on the second widget. The basic code is as follows :

commonContext = new QGLContext(QGLFormat(QGL::DoubleBuffer));

QGLWidget *w1 = new QGLWidget(commonContext, NULL )

QGLWidget *w2 = new QGLWidget(commonContext, NULL, w1 );

Any thoughts you might have is appreciated.

Freddy

h123
14th November 2008, 02:59
might be you need to call QGLContext::create before passing it to the QGLWidgets...