title: calling Qt's QGraphicsView::setViewport with a custom QGLWidget
body: <p>I've derived from QGLWidget before, like so:</p>
  
  <pre><code>class MyGLWidget : public QGLWidget
  {
  public:
     // stuff...
  
     virtual void initializeGL() { /* my custom OpenGL initialization routine */ }
  
     // more stuff...
  };
  </code></pre>
  
  <p>However, I find that if I try to initialize a QGraphicsView with my custom QGLWidget as the viewport, initializeGL doesn't get called (setting a breakpoint within the Qt library, neither does QGLWidget::initializeGL() when created plain).</p>
  
  <pre><code>// initializeGL, resizeGL, paintGL not called
  ui.graphicsView-&gt;setViewport(new MyGLWidget(QGLFormat(QGL::DoubleBuffer)));
  
  // initializeGL, resizeGL, paintGL *still* not called
  ui.graphicsView-&gt;setViewport(new QGLWidget(QGLFormat(QGL::DoubleBuffer)));
  </code></pre>
  
  <p>Where is the correct location to place the code that currently resides in MyGLWidget::initializeGL()?</p>