Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. IOS: antialiasing issues on QT 5.2.1
Forum Updated to NodeBB v4.3 + New Features

IOS: antialiasing issues on QT 5.2.1

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shinyless
    wrote on last edited by
    #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:

    @
    QPainter painter;

    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();
    

    @

    1 Reply Last reply
    0
    • S Offline
      S Offline
      shinyless
      wrote on last edited by
      #2

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

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        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

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • S Offline
          S Offline
          steno
          wrote on last edited by
          #4

          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.

          "Bug":https://bugreports.qt-project.org/browse/QTBUG-35271

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved