title: Get depth buffer from QGLPixelBuffer
body: <p>I'm using OpenGL in a QT application. At some point I'm rendering to a QGLPixelBuffer. I need to get the depth buffer of the image, what I'd normally accomplish with glReadPixels(..., GL_DEPTH_COMPONENT, ...); I tried making the QGLPixelBuffer current and then using glReadPixels() but all I get is a white image.</p>
  
  <p>Here's my code</p>
  
  <pre><code>bufferCanvas-&gt;makeCurrent();
  [ ...render... ]
  QImage snapshot(QSize(_lastWidth, _lastHeight), QImage::Format_Indexed8);
  glReadPixels(0, 0, _lastWidth, _lastHeight, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, snapshot.bits());
  snapshot.save("depth.bmp");
  </code></pre>
  
  <p>Anything obviously wrong with it?</p>