title: OpenGL Depth Testing in Qt not working
body: <p>I set the format with:</p>
  
  <pre><code>QGLFormat format = QGLFormat(QGL::DoubleBuffer | QGL::DepthBuffer);
  setFormat(format);
  </code></pre>
  
  <p>in the <em>constructor</em>.</p>
  
  <p>Then in <em>initializeGL</em> I set depthTesting on.</p>
  
  <pre><code>void VoxelEditor::initializeGL()
  {
      glClearDepth(2000.0);                                   // Enables Clearing Of The Depth Buffer
      glEnable(GL_DEPTH_TEST);                            // Enables Depth Testing
      glDepthFunc(GL_LESS);                               // The Type Of Depth Test To Do
      glShadeModel(GL_SMOOTH);                            // Enables Smooth Color Shading
      glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);  // Really Nice Perspective Calculations
  }
  </code></pre>
  
  <p>In paintGL I clear the depth buffer.</p>
  
  <pre><code>void VoxelEditor::paintGL()
  {
      glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
      draw();
  }
  </code></pre>
  
  <p>I remember it used to work with less vertices, so it might be that I'm using too many for the depthbuffer to handle(?).
  I have 32*32*32 voxels which are drawn half of most of the time, so 98304 quads.</p>
  
  <p>Depth testing however still does not work and shows the quads in order of execution.</p>