OpenGL antialiasing problem
Solved
General and Desktop
-
Hi fellow programers.
I have a problem with antialiasing in a QOpenGLWidget dirived widget. In the paintEvent I haveQPainter painter(this); painter.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing); if(refreshAll) { QPixmap tmpP(width(), height()); tmpP.fill(QColor(90,90,90)); QPainter painter_tmp(&tmpP); painter_tmp.setRenderHints(QPainter::Antialiasing | QPainter::SmoothPixmapTransform | QPainter::TextAntialiasing); //Some drawing here .... BackGroundMapP = tmpP.copy(0,0,tmpP.width(), tmpP.height()); //BackGroundMapP is s Pixmap refreshAll= false; } painter.drawPixmap(0,0,BackGroundMapP); //Some more drawing here ..... qDebug() << painter.renderHints(); // This is showing that the flags are set OK.
But the result is without Antialiasing or Text Antialiasing for everything drawn by painter. If I test to see if the flags are set correctly I get that they are. All drawn with painter_tmp is Antialiased though!! So what could be the problem? Apparently there are no driver problems, as everything drawn with painter_tmp is working fine.
-
Hi,
What version of Qt ? On what OS ?
-
Well I set the attribute for the app
a.setAttribute(Qt::AA_UseDesktopOpenGL);
Do I have to set the QSurfaceFormat for the widget too?