Important: Please read the Qt Code of Conduct -

IOS: antialiasing issues on QT 5.2.1

  • I have several issues with antialiasing on mobile devices using QT 5.2.1 release:

    Edit : unrelated to antialiasing, there's a screen bleeding bug on android, use "gradients" demo to reproduce.

    I tried using QPainter::HighQualityAntialiasing but this doesn't change anything.

    Here's the code of the paintEvent of the graph widget:

    QPainter painter;

    painter.setRenderHint(QPainter::Antialiasing, true);
    painter.setPen  (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.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.drawText(rect, Qt::AlignCenter, tr("GRAPH"));


  • Update: on android, this happens even when antialiasing is turned off, so this is rather a QPainter bug :/

  • Lifetime Qt Champion

    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": 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.


Log in to reply