Rectangle and text drawn using QQuickPaintedItem isn't sharp in iOS devices



  • I am having problem with rectangle and text drawn using QPainter on iOS devices ONLY. I tried building it into different iOS simulators (iP4S, iP5/S, iP6/+) and actual devices (iP4S, iP6, iPad Air) the same problem though less visible on large screen devices. The problem didn't occur on Android.

    QQuickPaintedItem antialiasing and smooth property have been enabled within the constructor.
    QPoints of the rectangle were all integers and didn't fall into floating coordinates.
    RenderHint has been enabled.
    I've tried using QPainterPath in creating roundedRect, same issue.

    Here's the sample:

    sample

    Please advise, TIA.



  • Regarding the text, found out that it has been scaled that is why it appeared pixelated.
    Read in one of the topic here that anti aliasing isn't working on iOS.

    Is there any work-around on this?


  • Qt Champions 2016

    I have got the same problem. The circle / triangle rendered via QQuickPaintedItem is blurred. Since the geometry system used in Qt iOS is "point" instead of "pixel". (e.g iPhone 6 : 1 pt = 2 px , iPhone 6+ : 1 pt = 3px). The rendered image will be scaled up to 2x / 3x . AA is not helpful in this case.

    Finally , I can not find any way to fix with QQuickPaintedItem. I just changed to use QQuickItem.



  • @benlau said:

    Finally , I can not find any way to fix with QQuickPaintedItem. I just changed to use QQuickItem.

    Hi, thank you for your response. Since you used QQuickItem instead, did you used updatePaintNode() in painting and didn't used QPainter?

    Can you please provide me a simple code in implementing QQuickItem?
    Actually, I tried creating rectangles using QSGGoemetryNode however i can't find any example on how to draw text using QSG without using QPainter.
    Sorry i'm still new to integrating c++ in QML. TIA.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.