Maybe you're missing a call to QGLWidget::glInit() somewhere?