title: What steps are necessary to enable antialiasing when using a QPainter on a QGLWidget?
body: <p>I am trying to draw basic shapes on a QGLWidget. I am trying to enable antialiasing to smooth out the lines, but it is not working.</p>
  
  <p>This is what I am trying at the moment:</p>
  
  <pre><code>QGLWidget *widget = ui-&gt;renderWidget;
  
  QPainter painter;
  
  widget-&gt;makeCurrent();
  glEnable(GL_MULTISAMPLE);
  glEnable(GL_LINE_SMOOTH);
  
  painter.setRenderHint(QPainter::Antialiasing);
  painter.setRenderHint(QPainter::HighQualityAntialiasing);
  
  painter.begin(widget);
  </code></pre>
  
  <p>However, anything drawn with this painter still has jagged edges. What else do I need to do?</p>