IOS: antialiasing issues on QT 5.2.1
I have several issues with antialiasing on mobile devices using QT 5.2.1 release:
- on Android, line antialiasing doesn't render correctly around the center of the screen, as seen here: "Screenshot Android":http://kbz.shini.free.fr/img/qtandroid_antialiasingbug.png
Edit : unrelated to antialiasing, there's a screen bleeding bug on android, use "gradients" demo to reproduce.
- on iOS, antialiasing works only on text, everything else drawn by QPainter don't have any antialiasing applied: "Screenshot iOS":http://kbz.shini.free.fr/img/qtios_antialiasingbug.PNG
I tried using QPainter::HighQualityAntialiasing but this doesn't change anything.
Here's the code of the paintEvent of the graph widget:
painter.begin(this); painter.setRenderHint(QPainter::Antialiasing, true); painter.setPen (Qt::white ); painter.setBrush(Qt::white); painter.drawRect(0, 0, width(), height()); painter.setPen (Qt::NoPen ); painter.setBrush(QColor(r,g,b)); // r,g,b are random ints between 0 and 255 painter.drawRoundedRect(0.0f, 0.0f, width(), height(), 10.0f, 10.0f); QRectF rect(0.0f,0.0f,width(), height()/2); painter.setBrush(Qt::NoBrush); painter.setPen (QPen(Qt::white,1.0f )); QPolygonF polyline; polyline << QPointF(0.0f, height()); for(int xCoord = 0; xCoord < 50; xCoord+=4) polyline << QPointF(xCoord*4, yRand[xCoord]); // yRand: array of randomized ints polyline << (QPointF(width(), height())); painter.drawPolyline(polyline); painter.drawText(rect, Qt::AlignCenter, tr("GRAPH")); painter.end();
Update: on android, this happens even when antialiasing is turned off, so this is rather a QPainter bug :/
Hi and welcome to devnet,
Since Qt 5.3 is around the corner, you should consider testing it to see if the issue is still present. If so, have a look at the "bug report system":http://bugreports.qt-project.org to see if it's something known, if not please consider opening a new report providing as much details as possible as well as a minimal compilable example that shows the problem
I was searching for this same problem and came across this bug logged last year. The last comment says it might be fixed in 5.4.