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.
This is what I am trying at the m
I found the solution. When debugging a different issue, I found messages in my debug output to the effect that you can't set renderhints before the call to begin().
The following works:
QGLWidget *widget = ui->renderWidget;
QPainter painter;
widget->makeCurrent();
glEnable(GL_MULTISAMPLE);
glEnable(GL_LINE_SMOOTH);
painter.begin(widget);
painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::HighQualityAntialiasing);