might be you need to call QGLContext::create before passing it to the QGLWidgets...