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 moment:
QGLWidget *widget = ui->renderWidget;
QPainter painter;
widget->makeCurrent();
glEnable(GL_MULTISAMPLE);
glEnable(GL_LINE_SMOOTH);
painter.setRenderHint(QPainter::Antialiasing);
painter.setRenderHint(QPainter::HighQualityAntialiasing);
painter.begin(widget);
However, anything drawn with this painter still has jagged edges. What else do I need to do?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…